Macro to paste to every other column

josh921

New Member
Joined
Feb 24, 2011
Messages
31
I have gotten a macro from a contributor on this forum and wondering if there is a way to change the paste portion so that values are pasted to every other column for the given row starting with column B. Desired outcome is that copied cell B3 is pasted in cell B 'Number' on destination, then copied C3 is pasted in D 'Number' and so on. Current macro looks like the following:

Sub Macro4()
Dim MyDate
Dim Number As Integer

MyDate = Date 'MyDate contains the current system date.
Sheets("Raw Data").Select
Range("A3").Select 'Start searching for dates in A3
Again:
If ActiveCell.Value = "" Then Exit Sub
If ActiveCell.Value = MyDate Then
Number = ActiveCell.Row
Sheets("Sheet2").Select
Range("B3:F3").Copy
Sheets("Raw Data").Select
Range("B" & Number).Select
'Paste as values in Raw Data
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveCell.Offset(1, 0).Select
ActiveCell.Offset(0, -1).Select
GoTo Again
Else
ActiveCell.Offset(1, 0).Select
GoTo Again
End If
End Sub
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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