Write Macro to input formula to copy cell

RHowell2380

New Member
Joined
Mar 24, 2021
Messages
3
Office Version
  1. 2013
Platform
  1. Windows
I need to be able to insert the formula to copy a cell in 'sheet 1' to sheet 2 with skipping rows.

I have to take A1on 'sheet 1' and copy it to A1 on 'sheet 2'. That's the easy part I need to now take A2 on sheet 1 and I have copy it to A19 on 'sheet 2'. I have to basically I have to take sheet 1 A1:A150 and copy to sheet 2 A1:A2850 skipping 19 rows on sheet 2 each time.

The real tricky part is sheet rows are always changing so I can't copy. I have to use ='sheet1'A1 (formula in cell A1 on sheet2)
='sheet1'A2 (formula in cell A19 on sheet2).

Hope this makes sense!
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Try this:
VBA Code:
Sub test()

With Worksheets("Sheet2")
For i = 1 To 150
  rowno = 1 + ((i - 1) * 18)
 .Range(.Cells(rowno, 1), .Cells(rowno, 1)).Formula = "=Sheet1!A" & i
Next i
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top