Excel Macros with VBA ASAP
Here I am trying to add form data into Excel sheet 2
i written this code but giving problem
anybody suggest to me
Do While (Worksheets(2).Cells(row, col1) = "")
If Worksheets(2).Cells(row, col1) = "" And Worksheets(2).Cells(row, col2) = "" And Worksheets(2).Cells(row, col3) = "" And Worksheets(2).Cells(row, col4) = "" Then
Worksheets(2).Cells(row, col1) = name
Worksheets(2).Cells(row, col2) = datefrom
Worksheets(2).Cells(row, col3) = dateto
Worksheets(2).Cells(row, col4) = reason
Exit Sub
ElseIf Worksheets(2).Cells(row, col1) <> "" And Worksheets(2).Cells(row, col2) <> "" Then
row = row + 1
End If
Loop
|