Wednesday, October 7, 2020

Macro to highlight alternate cells in excel | VBA to highlight alternate cells in excel

 Macro to highlight alternate cells in excel | VBA to highlight alternate cells in excel

Open Excel Sheet


Press Alt + F11 Key 


Go to the Insert Menu and Click on new Module


in New Module copy and paste the above VBA code and save.


Now Press Alt + F8  and new windows will open which is shown in below figure,


in that windows, you will ask to enter a key to create a shortcut for Paste Special


Enter a letter in the box. 


Macro to highlight alternate cells in excel | VBA to highlight alternate cells in excel 


Sub HighlightAlternateRows()
Dim Myrange As Range
Dim Myrow As Range
Set Myrange = Selection
For Each Myrow In Myrange.Rows
   If Myrow.Row Mod 2 = 1 Then
      Myrow.Interior.Color = vbCyan
   End If
Next Myrow
End Sub

No comments:

Post a Comment

Lion King 2019 Telugu Movie | Lion King Telugu Movie | Lion King Telugu Version Movie

  Lion King 2019 Telugu Version Movie has been released and running successfully in theaters. Telugu Top Heros J agapathi Babu and Nani g...