Anbuselvam
05-10-2018, 05:32 AM
Hi
I have recorded the macro to run the calculation steps as below. Also, Attached a sheet for better understanding.
Sub Run_Calc()
'
' Run_Calc Macro
'
' Keyboard Shortcut: Ctrl+g
'
Range("S2:K2").Select
Selection.Copy
Range("S8:K39").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Calculate
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Calculate
Range("C7").Select
Selection.End(xlDown).Select
End Sub
By running the above macro, sheet got calculated S8 to DK39.
My desired result is,
The above function should run only the number of rows I have selected instead of S8 to DK39.
For Example, If I run the macro while selecting the Row number 10 to 15, Then it should calculate S10 to DK15 only.
How do I change them to get desired results?
Expecting positive reply. Thanks in Advance.
I have recorded the macro to run the calculation steps as below. Also, Attached a sheet for better understanding.
Sub Run_Calc()
'
' Run_Calc Macro
'
' Keyboard Shortcut: Ctrl+g
'
Range("S2:K2").Select
Selection.Copy
Range("S8:K39").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Calculate
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Calculate
Range("C7").Select
Selection.End(xlDown).Select
End Sub
By running the above macro, sheet got calculated S8 to DK39.
My desired result is,
The above function should run only the number of rows I have selected instead of S8 to DK39.
For Example, If I run the macro while selecting the Row number 10 to 15, Then it should calculate S10 to DK15 only.
How do I change them to get desired results?
Expecting positive reply. Thanks in Advance.