Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default .cells question

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default .cells question

Hi

This should do it (untested)

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

Regards,
Per

"Mona" skrev i meddelelsen
...
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!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default .cells question

dim iCol as long
for icol = 9 to 15
'do what you want...
.range(.cells(cstartrow,icol),.cells(cstartrow+nro ws,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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default .cells question

perfect!!

"Per Jessen" wrote:

Hi

This should do it (untested)

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

Regards,
Per

"Mona" skrev i meddelelsen
...
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
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
< question for multiply cells. Robert Excel Worksheet Functions 2 February 27th 09 06:17 AM
Excell named cells or labeled cells question [email protected] Excel Programming 8 June 25th 06 05:15 PM
Excel named cells or labeled cells question [email protected] Excel Programming 2 June 25th 06 04:39 PM
Find cells question ? Mario Reiley Excel Programming 6 August 6th 04 04:32 PM
Question On Formatting cells excelnaive Excel Programming 2 April 21st 04 02:46 PM


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