how to write visual basic macros

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top