Hello everyone I hope everything is good with you.
I'm newbie at VBA coding and I'm looking for a little help on my code here.
The idea is simple I have 2 Worksheets ("Input" and "template") I need to copy values from range A of Worksheet "Input" and paste it in "template" cells, however in "template", the cells starts in A3 and next is A7, A11 and so on until 39.
For instance:
Input:A1 = template:A3,
Input:A2 = template:A7,
Input:A3 = template:A11...
I'm pasting my code here, but I'm not sure how to add this second loop for template sheet, I've tried to use a for and increment it by 4 but it didn't work.
Any help will appreciated.
Sub CopyPaste()
' CopyPaste Test Macro
'
' Keyboard Shortcut: Ctrl+x
'
Dim rng As Range
Dim i As Integer
For Each Cl In Sheets("Input").Range("A1", Range("A" & Rows.Count).End(xlUp))
For i = 3 To 39
If Cl.Value <> "" Then
Sheets("template").Range("A" & i).Value = Cl.Value
i = i + 4
Next Cl
End Sub
I'm newbie at VBA coding and I'm looking for a little help on my code here.
The idea is simple I have 2 Worksheets ("Input" and "template") I need to copy values from range A of Worksheet "Input" and paste it in "template" cells, however in "template", the cells starts in A3 and next is A7, A11 and so on until 39.
For instance:
Input:A1 = template:A3,
Input:A2 = template:A7,
Input:A3 = template:A11...
I'm pasting my code here, but I'm not sure how to add this second loop for template sheet, I've tried to use a for and increment it by 4 but it didn't work.
Any help will appreciated.
Sub CopyPaste()
' CopyPaste Test Macro
'
' Keyboard Shortcut: Ctrl+x
'
Dim rng As Range
Dim i As Integer
For Each Cl In Sheets("Input").Range("A1", Range("A" & Rows.Count).End(xlUp))
For i = 3 To 39
If Cl.Value <> "" Then
Sheets("template").Range("A" & i).Value = Cl.Value
i = i + 4
Next Cl
End Sub