Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to write visual basic macros

I need to copy a range (c1:n1) every 11th row in a long spreadsheet. The
data is numerical and will be used in a formula that will reference this
data. The rows to paste into start with C11:N11 and run through C787:N787.

I also need to a macro to copy a formula in the same manner and size.

HELP?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default how to write visual basic macros

for each cell in Range("C11:C787")
if cell.row mod 11 = 0 then
range("C1:N1").copy destination:=cell
end if
Next

that would do

11, 22, 33, 44, 55, etc

if you want
11, 21, 31, 41, 51,

change to

for each cell in Range("C11:C787")
if (cell.row-1) mod 10 = 0 then
range("C1:N1").copy destination:=cell
end if
Next

--
Regards,
Tom Ogilvy

"Ken Michaels" <Ken wrote in message
...
I need to copy a range (c1:n1) every 11th row in a long spreadsheet. The
data is numerical and will be used in a formula that will reference this
data. The rows to paste into start with C11:N11 and run through

C787:N787.

I also need to a macro to copy a formula in the same manner and size.

HELP?



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
Imported Visual Basic Module - Save Macros for use in Excel Pat Adams Excel Discussion (Misc queries) 1 December 2nd 09 09:44 PM
Visual Basic Macros Mia Skier Excel Discussion (Misc queries) 3 June 8th 08 04:12 AM
Visual Basic Macros, relative position [email protected] Charts and Charting in Excel 3 November 14th 06 11:33 PM
changing the visual basic in office 2003 to visual studio net bigdaddy3 Excel Discussion (Misc queries) 1 September 13th 05 10:57 AM
creating an exe file with visual basic (installation file for Macros and Userforms) [email protected] Excel Programming 3 August 5th 04 10:16 AM


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