Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Question on how to reference multiple cells in VBA

I am trying to select cells in a row that are not contiguous. Example
in row 15 i want select C, E, J, I, and K. I used the record macro
function to get

Range("C15,E15,G15,I15,K15").Select

but it will not always be row 15. I am adding rows to a spreadsheet via
a custom written macro and I am trying to select the different cells to
format them.

Thank you for any help,

Louis Markham

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Question on how to reference multiple cells in VBA

One way

Range("C" & i & ",E" & i & ",G" & i & ",I" & i & ",K" & i).Select

where i has your row number

Tim

wrote in message oups.com...
I am trying to select cells in a row that are not contiguous. Example
in row 15 i want select C, E, J, I, and K. I used the record macro
function to get

Range("C15,E15,G15,I15,K15").Select

but it will not always be row 15. I am adding rows to a spreadsheet via
a custom written macro and I am trying to select the different cells to
format them.

Thank you for any help,

Louis Markham



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Question on how to reference multiple cells in VBA

Thanks a ton!!!!!

M


Tim Williams wrote:
One way

Range("C" & i & ",E" & i & ",G" & i & ",I" & i & ",K" & i).Select

where i has your row number

Tim

wrote in message oups.com...
I am trying to select cells in a row that are not contiguous. Example
in row 15 i want select C, E, J, I, and K. I used the record macro
function to get

Range("C15,E15,G15,I15,K15").Select

but it will not always be row 15. I am adding rows to a spreadsheet via
a custom written macro and I am trying to select the different cells to
format them.

Thank you for any help,

Louis Markham


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
how do I reference multiple cells? Penny Cooper Excel Discussion (Misc queries) 1 April 20th 07 05:24 PM
Multiple cells reference Elis Excel Worksheet Functions 7 April 2nd 07 08:34 PM
Populate multiple cells using the same reference nick Excel Worksheet Functions 0 October 3rd 05 03:33 PM
Reference multiple cells in if statement PAR Excel Worksheet Functions 1 June 10th 05 06:28 AM
Reference multiple cells Novice[_11_] Excel Programming 1 February 27th 04 04:28 PM


All times are GMT +1. The time now is 01:02 PM.

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

About Us

"It's about Microsoft Excel"