springy2003
Instructor
Hi, I was wondering if you can help me with a problem. It might sound confussing, so bear with me. I want to be able to use conditional formatting without actually selecting it from the Format menu at the top of the page. I know you can record it, but here comes the confussing bit.
I want to be able to find a range, without using the
Range("A1"
.Select and at the same time highlight the data in a column, again not using Range("A1:A2"
.Select. When highlighted, I want to conditional format it, so that the highlight data will now be formatted. The macro I have got at the moment is this!
Sub Macro1()
Dim minrow, maxcol
Sheets("sheet1"
.Select
Range("D13"
.Select
Selection.Copy
Do Until ActiveCell.Value = ""
ActiveCell.Offset(0, 1).Select
Loop
Selection.PasteSpecial Paste:=xlFormulas, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
minrow = ActiveCell.row
maxcol = ActiveCell.Column
ActiveCell.Offset(-3, 0).Select
MsgBox minrow & vbNewLine & maxcol
End Sub
'Range("L10"
.Activate
'Selection.FormatConditions.Delete
'Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLessEqual, _
' Formula1:="=$L$13"
'With Selection.FormatConditions(1).Font
' .Bold = True
' .Italic = True
' .ColorIndex = 3
'End With
'End Sub
But as you can see, I recorded this, and it uses the terms like range("A1"
.select, which I don't want since when I update and write data into another column, I want the macro to be able to spot where the new data has been inputed on the data sheet and be able to conditional format it. Do you understand or do I have to explain it better????
I want to be able to find a range, without using the
Range("A1"
Sub Macro1()
Dim minrow, maxcol
Sheets("sheet1"
Range("D13"
Selection.Copy
Do Until ActiveCell.Value = ""
ActiveCell.Offset(0, 1).Select
Loop
Selection.PasteSpecial Paste:=xlFormulas, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
minrow = ActiveCell.row
maxcol = ActiveCell.Column
ActiveCell.Offset(-3, 0).Select
MsgBox minrow & vbNewLine & maxcol
End Sub
'Range("L10"
'Selection.FormatConditions.Delete
'Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLessEqual, _
' Formula1:="=$L$13"
'With Selection.FormatConditions(1).Font
' .Bold = True
' .Italic = True
' .ColorIndex = 3
'End With
'End Sub
But as you can see, I recorded this, and it uses the terms like range("A1"