I need a help in selecting range while creating a macros. My requirement is I have recorded a macro which should work in any selected column the range it should select is from the previous column last data row to the top. In the below macro the problem is it is selecting the entire column and data is filled in the entire column from K3:K1048576. Please help me to fix this and it should work in any column.
Sub Macro3()
'
' Macro3 Macro
'
' Keyboard Shortcut: Ctrl+l
'
ActiveCell.FormulaR1C1 = "=RC[-1]/RC7"
ActiveCell.Select
Selection.NumberFormat = "0%"
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=0.75"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16383844
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Selection.Copy
ActiveCell.Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
End Sub
Bookmarks