ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   question about debug.print (https://www.excelbanter.com/excel-programming/341394-question-about-debug-print.html)

Gary Keramidas[_4_]

question about debug.print
 
if i set a variable, for example
Set LastRow = .Range(.Cells(1, "A"), .Cells(Rows.Count, "A").End(xlUp))

can i use debug.print or some other means to show me what lastrow actually
contains?

--


Gary




Rowan Drummond[_2_]

question about debug.print
 
Debug.Print LastRow.Address
will print the address to the immediate window. Or you could open the
locals window which shows the status of all variables while you are in
debug mode.

Regards
Rowan

Gary Keramidas wrote:
if i set a variable, for example
Set LastRow = .Range(.Cells(1, "A"), .Cells(Rows.Count, "A").End(xlUp))

can i use debug.print or some other means to show me what lastrow actually
contains?


Gary Keramidas[_4_]

question about debug.print
 
thanks rowan, that's what i needed to know

--


Gary


"Rowan Drummond" wrote in message
...
Debug.Print LastRow.Address
will print the address to the immediate window. Or you could open the
locals window which shows the status of all variables while you are in
debug mode.

Regards
Rowan

Gary Keramidas wrote:
if i set a variable, for example
Set LastRow = .Range(.Cells(1, "A"), .Cells(Rows.Count, "A").End(xlUp))

can i use debug.print or some other means to show me what lastrow
actually contains?




Cush

question about debug.print
 
Does this code actually give you a Row (as in LastRow) or does it
return a verticle range in col A??

"Gary Keramidas" wrote:

if i set a variable, for example
Set LastRow = .Range(.Cells(1, "A"), .Cells(Rows.Count, "A").End(xlUp))

can i use debug.print or some other means to show me what lastrow actually
contains?

--


Gary





Gary Keramidas[_4_]

question about debug.print
 
lastrow is a range in this instance, so it would return something like the
following:
$A$1:$A$29

dimming lastrow as long and using this:
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
will give you this:
29


--


Gary


"cush" wrote in message
...
Does this code actually give you a Row (as in LastRow) or does it
return a verticle range in col A??

"Gary Keramidas" wrote:

if i set a variable, for example
Set LastRow = .Range(.Cells(1, "A"), .Cells(Rows.Count, "A").End(xlUp))

can i use debug.print or some other means to show me what lastrow
actually
contains?

--


Gary








All times are GMT +1. The time now is 12:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com