PC Review


Reply
Thread Tools Rate Thread

.cells question

 
 
Mona
Guest
Posts: n/a
 
      11th Jun 2008
I have this formula:
..Range(.Cells(cStartRow, 9), .Cells(cStartRow + nRows, 9)).FillDown

cStartRow=12 and nRows=counter that counts the number of rows. 9=column.

I want to use this formula for column 9 through 15. I could repeat formula
7 times and change the column number but surely there is a better way!

Thanks in advance!
 
Reply With Quote
 
 
 
 
Per Jessen
Guest
Posts: n/a
 
      11th Jun 2008
Hi

This should do it (untested)

..Range(.Cells(cStartRow, 9), .Cells(cStartRow + nRows, 15)).FillDown

Regards,
Per

"Mona" <(E-Mail Removed)> skrev i meddelelsen
news:20D1091F-809B-4E41-AB20-(E-Mail Removed)...
>I have this formula:
> .Range(.Cells(cStartRow, 9), .Cells(cStartRow + nRows, 9)).FillDown
>
> cStartRow=12 and nRows=counter that counts the number of rows. 9=column.
>
> I want to use this formula for column 9 through 15. I could repeat
> formula
> 7 times and change the column number but surely there is a better way!
>
> Thanks in advance!


 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      11th Jun 2008
dim iCol as long
for icol = 9 to 15
'do what you want...
.range(.cells(cstartrow,icol),.cells(cstartrow+nrows,icol)).filldown
next icol



Mona wrote:
>
> I have this formula:
> .Range(.Cells(cStartRow, 9), .Cells(cStartRow + nRows, 9)).FillDown
>
> cStartRow=12 and nRows=counter that counts the number of rows. 9=column.
>
> I want to use this formula for column 9 through 15. I could repeat formula
> 7 times and change the column number but surely there is a better way!
>
> Thanks in advance!


--

Dave Peterson
 
Reply With Quote
 
Mona
Guest
Posts: n/a
 
      11th Jun 2008
perfect!!

"Per Jessen" wrote:

> Hi
>
> This should do it (untested)
>
> ..Range(.Cells(cStartRow, 9), .Cells(cStartRow + nRows, 15)).FillDown
>
> Regards,
> Per
>
> "Mona" <(E-Mail Removed)> skrev i meddelelsen
> news:20D1091F-809B-4E41-AB20-(E-Mail Removed)...
> >I have this formula:
> > .Range(.Cells(cStartRow, 9), .Cells(cStartRow + nRows, 9)).FillDown
> >
> > cStartRow=12 and nRows=counter that counts the number of rows. 9=column.
> >
> > I want to use this formula for column 9 through 15. I could repeat
> > formula
> > 7 times and change the column number but surely there is a better way!
> >
> > Thanks in advance!

>
>

 
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
Group Cells Question GMc Microsoft Excel Worksheet Functions 0 5th Jun 2008 03:54 PM
Excell named cells or labeled cells question farseer@optonline.net Microsoft Excel Programming 8 25th Jun 2006 05:15 PM
Excel named cells or labeled cells question farseer@optonline.net Microsoft Excel Programming 2 25th Jun 2006 04:39 PM
Another question on selecting cells from a range of cells Mike Microsoft Excel Programming 2 22nd Mar 2004 01:11 AM
Re: cells question Tom Ogilvy Microsoft Excel Misc 0 19th Jul 2003 05:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:03 AM.