Hi
I have an autogenerated worksheet in sheet1 I am trying to create a macro for which I want to find the last used cell in column "D". The data in column D start from row 6 and when i am using the row.end method to find the last used row i am getting the value as 1 instead of 2843. The code I am using is:
I have tried replacing "D" with "D6" but that gives error and also note that that this code is placed in PERSONAL XLSB folder.
TIA
I have an autogenerated worksheet in sheet1 I am trying to create a macro for which I want to find the last used cell in column "D". The data in column D start from row 6 and when i am using the row.end method to find the last used row i am getting the value as 1 instead of 2843. The code I am using is:
Dim lnglastrow As Long
lnglastrow = Sheet1.Cells(Rows.Count, "D").End(xlUp).Rows
MsgBox lnglastrow
I have tried replacing "D" with "D6" but that gives error and also note that that this code is placed in PERSONAL XLSB folder.
TIA