Hi all,
Here is a VBA query which probably has a simple solution...
I have designed a user form which when you enter data into it and hit "ok" it sends the information to a worksheet named "data". For each new record entered into the form, the code I have used looks for the next empty row in the "data" sheet and adds the information. Here is the code:
ActiveWorkbook.Sheets("Data").Select
NextRow = _
Application.WorksheetFunction.CountA(Range("A:A")) + 1
Cells(NextRow, 1) = FamNameTB.Text
Cells(NextRow, 2) = etc, etc, etc
My problem is I need this to look for the next empty row, but start inputing the data in column B and leave column A blank. At the moment it sends the data to the first blank row starting in column A. I would have thought simply changing the range from Range("A:A") to ("B:B") would work but it doesn't. I have tried using the offset function but this also has not worked as my coding was probably incorrect. Any suggestions? Thanks.
Here is a VBA query which probably has a simple solution...
I have designed a user form which when you enter data into it and hit "ok" it sends the information to a worksheet named "data". For each new record entered into the form, the code I have used looks for the next empty row in the "data" sheet and adds the information. Here is the code:
ActiveWorkbook.Sheets("Data").Select
NextRow = _
Application.WorksheetFunction.CountA(Range("A:A")) + 1
Cells(NextRow, 1) = FamNameTB.Text
Cells(NextRow, 2) = etc, etc, etc
My problem is I need this to look for the next empty row, but start inputing the data in column B and leave column A blank. At the moment it sends the data to the first blank row starting in column A. I would have thought simply changing the range from Range("A:A") to ("B:B") would work but it doesn't. I have tried using the offset function but this also has not worked as my coding was probably incorrect. Any suggestions? Thanks.