Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Dumb Dim Question

I have what is probably a simple dim question....

I have set a variable....
Dim MyVar
MyVar = Range("AG1").Text

Now I want to select a range of rows from the 2nd row to the row# that
is my variable. (EX.(If MyVar is 10, then I want to select rows 2 thru
10)

I tried..
Rows("2:MyVar").Select
and it obviously failed with a type mismatch.

Thanks in advance!
-Mike

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Dumb Dim Question

Michael,

Try

Rows("2:" & MyVar).Select


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Michael Smith" wrote in message
...
I have what is probably a simple dim question....

I have set a variable....
Dim MyVar
MyVar = Range("AG1").Text

Now I want to select a range of rows from the 2nd row to the

row# that
is my variable. (EX.(If MyVar is 10, then I want to select

rows 2 thru
10)

I tried..
Rows("2:MyVar").Select
and it obviously failed with a type mismatch.

Thanks in advance!
-Mike

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dumb Question David Excel Worksheet Functions 2 May 28th 07 08:13 PM
dumb question uw805 Excel Worksheet Functions 6 June 8th 06 05:06 PM
Very dumb question gregorsamsa Excel Discussion (Misc queries) 2 March 23rd 06 03:15 PM
No Dumb Question darkbearpooh1 Excel Worksheet Functions 1 January 25th 06 03:32 PM
dumb question john m Excel Programming 2 December 24th 03 04:13 PM


All times are GMT +1. The time now is 08:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"