How to make Macro Repeat

Closed
Fred - 8 Apr 2016 à 08:22
 Blocked Profile - 8 Apr 2016 à 16:41
Hello,

I am trying to run a macro where I multiply a range (B3: B615) by a number (B2). The problem is I want to do this for every column in my worksheet. Thus I want (C3: C615) multiplied by C2, and (D3: D615) multiplied by D2, etc.

I was able to make a macro to complete this task for only one column, but does anyone know how to make it repeat for each column? Thank you!

Sub Macro1()
'
' Macro1 Macro
'

'
Range("B2").Select
Selection.Copy
Range("B3:B615").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
End Sub
Related:

1 response

Blocked Profile
8 Apr 2016 à 16:41
Well, build a range, and count the column in the range. Then a For loop for each column in range!