Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Variable in Rows() function

Status
Not open for further replies.

RiderJon

Programmer
Aug 26, 2002
190
0
0
FR
Hi:

I am just starting with excel macros - so bear with me.

How do I pass a variable to reference rows.

for example I have

Dim Last1 As Integer
Last1 = 12

Rows("1:Last1").RowHeight = 15

But it gives an error in the Rows("1:Last") .....

RiderJon
"I might have created ctrl+alt+del,
But Bill made it famous" - Dr. Dave
 
try this....

Rows("1:" + CStr(last1)).RowHeight = 25
 
oops...
you only want 15

Rows("1:" + CStr(last1)).RowHeight = 15
 
wonderful. Thanx ETID.

RiderJon
"I might have created ctrl+alt+del,
But Bill made it famous" - Dr. Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top