maabadi
Well-known Member
- Joined
- Oct 22, 2012
- Messages
- 2,681
- Office Version
- 2019
- 2016
- Platform
- Windows
Hi
I want a macro to when I change or add value in one cell (e.g: D5) then auto-fill the below row ( row no. 6 from column A to M) and convert the formula in above row (row no. 4 from column A to M) convert to number to decrease size of file.
I recorded this macro in excel but it only work for one row.
Please Help me and correct it.
I want a macro to when I change or add value in one cell (e.g: D5) then auto-fill the below row ( row no. 6 from column A to M) and convert the formula in above row (row no. 4 from column A to M) convert to number to decrease size of file.
I recorded this macro in excel but it only work for one row.
Please Help me and correct it.
Code:
Sub Macro2()
'
' Macro2 Macro
'
'
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "45"
ActiveCell.Offset(0, -4).Range("A1:M1").Select
Selection.AutoFill Destination:=ActiveCell.Range("A1:M2"), Type:= _
xlFillDefault
ActiveCell.Range("A1:M2").Select
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
ActiveCell.Offset(-1, 0).Range("A1:M1").Select
Selection.Copy
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
ActiveCell.Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub