vidplaylist
Board Regular
- Joined
- Aug 3, 2011
- Messages
- 78
Every month i copy the formula to next column on many sheets. Each sheets has different number of rows. I tried a macro to copy and paste the formula on next column but every sheet has different numbers of total rows as a result it copy the formula on only number of columns which are part of recorded macro.
Can someone suggest a vba code that i can input the number of rows when i run macro on each sheet.
Sub formula1mrexcel()
' recorded macro
' copy formula to next column each month
Range("F3:F50").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=-42
Range("G3").Select
ActiveSheet.Paste
Range("F3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
Thanks
Can someone suggest a vba code that i can input the number of rows when i run macro on each sheet.
Sub formula1mrexcel()
' recorded macro
' copy formula to next column each month
Range("F3:F50").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=-42
Range("G3").Select
ActiveSheet.Paste
Range("F3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
Thanks