Peter Chan
asked on
What value it is having
Hi,
I want to know what value
ConfigWS.Cells(Rows.Count, "C").End(xlUp).Row
is going to have, each time, when running the macro.
I want to know what value
ConfigWS.Cells(Rows.Count,
is going to have, each time, when running the macro.
It will return the row number of the last non-blank row in column C of the worksheet that ConfigWS refers to.
ASKER
If you want the last row in column C then try
lngLastRow = Range("C1048576").End(xlUp ).Row
If you want the last row in column D then try
lngLastRow = Range("D1048576").End(xlUp ).Row
In both cases lngLastRow is defined like this
Dim lngLastRow As Long
lngLastRow = Range("C1048576").End(xlUp
If you want the last row in column D then try
lngLastRow = Range("D1048576").End(xlUp
In both cases lngLastRow is defined like this
Dim lngLastRow As Long
From what you have posted the call would return 29 and so using this you could do something like
Some assumptions here
From what you are describing the problem is not in the call you have posted but elsewhere in the code. Any chance you could post the workbook for us to look at?
lastRow = ConfigWS.Cells(Rows.Count, "C").End(xlUp).Row
ColDLastEntry = ConfigWS.Range("D" & lastRow).value
Some assumptions here
The sheet in your screenshot is the sheet referenced by ConfigWS
There are no entries outside to scope of your screenshot
From what you are describing the problem is not in the call you have posted but elsewhere in the code. Any chance you could post the workbook for us to look at?
ASKER
I am not able to refer to this value
Range("D1048576").End(xlUp ).Row
Using these
ConfigWS.Range("D" & lastRow).value
is zero.
Range("D1048576").End(xlUp
Using these
Dim lastRow As Long
lastRow = ConfigWS.Cells(Rows.Count, "C").End(xlUp).Row
I see this value ConfigWS.Range("D" & lastRow).value
is zero.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
So if Column C has values in Cells C1, C2 & C3 only this call will return 3