Change the formatting of row by select a single cell & Editing should be working

  • Thread starter Thread starter Vikky
  • Start date Start date
V

Vikky

Hi All;

I require such a sheet code which can help me in Changing the
formatting of row (like A1:A25) of selected cell (A4 is Selected) and
allow me to use editing (Cut, Copy, Paste, Undo etc).


Currently I'm Using following code but this does not allow me to use
editing (Cut, Copy, Paste, Undo etc) and I can not decide the range for

working this sheet code.


Any kind help is appreciated.


Private Sub Search_Click()
Sheets("Quick Search").Visible = True
ActiveWindow.SelectedSheets.Visible = False
Sheets("Quick Search").Select
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim MyRng As Range
Set MyRng = Target.EntireRow
Application.EnableEvents = False
On Error GoTo end1
Application.Cells.FormatConditions.Delete
With MyRng
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=ROW()=ROW(INDIRECT(CELL(""address"")))"
With .FormatConditions(1).Font
.Bold = True
.Italic = True
.ColorIndex = 1
End With
.FormatConditions(1).Interior.ColorIndex = 43
End With
end1:
Application.EnableEvents = True
End Sub


Thanks


Vikky
 
This modification of my code will color row1:25 of the selected column. You
should be able to copy to another sheet.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim MyRng As Range
ac = Target.Column
Set MyRng = Range(Cells(1, ac), Cells(25, ac))
Application.EnableEvents = False
On Error GoTo end1
Application.Cells.FormatConditions.Delete
With MyRng
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=column()=column(INDIRECT(CELL(""address"")))"
With .FormatConditions(1).Font
.Bold = True
.Italic = True
.ColorIndex = 1
End With
.FormatConditions(1).Interior.ColorIndex = 43
End With
end1:
Application.EnableEvents = True
End Sub
 
Back
Top