PC Review


Reply
Thread Tools Rate Thread

Question on how to reference multiple cells in VBA

 
 
louisamarkham@gmail.com
Guest
Posts: n/a
 
      27th Jun 2006
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 With Quote
 
 
 
 
Tim Williams
Guest
Posts: n/a
 
      27th Jun 2006
One way

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

where i has your row number

Tim

<(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>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 With Quote
 
 
 
 
Louis Markham
Guest
Posts: n/a
 
      27th Jun 2006
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
>
> <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> >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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert cells reference to string reference?? Robert Crandal Microsoft Excel Programming 2 1st Dec 2009 08:46 AM
Formulas that reference cells that reference another cell =?Utf-8?B?QW5kcmVh?= Microsoft Excel Misc 7 19th Oct 2006 08:14 AM
link multiple cells to multiple cells jpoltor Microsoft Excel Misc 2 25th Mar 2006 09:59 AM
make multiple cells in 1 worksheet equal multiple cells in another =?Utf-8?B?cmlsZXk0NTQ=?= Microsoft Excel Worksheet Functions 1 19th Jan 2006 04:00 PM
How to Change the Color of multiple cells when multiple cells returns text of "x" b_mcmillen2002 Microsoft Excel Worksheet Functions 0 6th Nov 2003 08:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:42 AM.