Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dolphinv4
 
Posts: n/a
Default Select a certain number of cells in a row

Hi,

I'd like to have the macro to select row 5 to 10 in the active column. May I
know what is the VB code to write?

Regards,
Valerie
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default Select a certain number of cells in a row

maybe...

dim myRng as range
dim myCol as long

with activesheet
mycol = activecell.Column
set myrng = .range(.cells(5,mycol),.cells(10,mycol))
end with

myrng.select

=======
or

with activesheet
.cells(5,activecell.column).resize(6).select
end with

I'm not quite sure why you want to select that range. But for the most part, if
you act directly on the range (and avoid .selects), you're code will work faster
and be easier to modify.

Dolphinv4 wrote:

Hi,

I'd like to have the macro to select row 5 to 10 in the active column. May I
know what is the VB code to write?

Regards,
Valerie


--

Dave Peterson
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
Select unused number drbobsled Excel Worksheet Functions 1 August 26th 05 07:03 PM
How do I select individual cells for a chart micachou Charts and Charting in Excel 2 July 29th 05 12:47 PM
Number format exactly the same, displays differently in some cells eider Excel Discussion (Misc queries) 1 July 29th 05 12:26 AM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM
Count number of shaded cells Maddoktor Excel Discussion (Misc queries) 2 December 20th 04 08:35 PM


All times are GMT +1. The time now is 09:40 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"