Showing posts with label VBA. Show all posts
Showing posts with label VBA. Show all posts

HOW TO HIGHLIGHT ROW AND COLUMN OF ACTIVE CELL USING VBA

How To Hightlight Row and Column Active Cell Using VBA In Excel

How to Highlight Row and Column of Active Cell Using VBA? 

If you have a large Data in Spreadsheet and you may want to highlight the select Cell's Row and Column so you can read your data very easily, HERE I can introduce you Interesting VBA Trick to highlight the row and column of the current cell select. when the cell is changed, the row and column highlight Automatically.

How to Highlight Row Using VBA


The Following these step can help you automatically highlight the row of the select cell. Follow the steps

Goto The Developer Tab on the Ribbon and click Visual Studio Button. Shortcut key is (Alt+F11)
Paste The Code In VBA Module 

Row Color Select Cell Using VBA


VBA CODE:

Option Explicit
Private LastAddress As String
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If LastAddress <> "" Then
Range(LastAddress).EntireRow.Interior.ColorIndex = xlNone
End If
ActiveCell.EntireRow.Interior.ColorIndex = 7
LastAddress = Target.Address
End Sub

Change Color Index Number To Change Color on Sheet

How to Highlight Column Using VBA

The Following these step can help you automatically highlight the column of the select cell. Follow the steps

Goto The Developer Tab on the Ribbon and click Visual Studio Button. Shortcut key is (Alt+F11)
Paste The Code In VBA Module 

Column Color Using VBA



VBA CODE:

Option Explicit
Private LastAddress As String
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If LastAddress <> "" Then
Range(LastAddress).EntireColumn.Interior.ColorIndex = xlNone
End If
ActiveCell.EntireColumn.Interior.ColorIndex = 7
LastAddress = Target.Address
End Sub


Change Color Index Number To Change Color on Sheet

How to Highlight Column and Row Using VBA


The Following these step can help you automatically highlight the column and row of the select cell. Follow the steps

Goto The Developer Tab on the Ribbon and click Visual Studio Button. Shortcut key is (Alt+F11)
Paste The Code In VBA Module


Column And Row Color Using VBA In Excel



VBA CODE:

Option Explicit
Private LastAddress As String
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If LastAddress <> "" Then
Range(LastAddress).EntireRow.Interior.ColorIndex = xlNone
Range(LastAddress).EntireColumn.Interior.ColorIndex = xlNone
End If
ActiveCell.EntireRow.Interior.ColorIndex = 7
ActiveCell.EntireColumn.Interior.ColorIndex = 5
LastAddress = Target.Address
End Sub


Watch Video For Easy Learning 






HOW TO DELETE EMPTY ROWS USING VBA IN MICROSOFT EXCEL

 
DELETE EMPTY ROWS WITH VBA CODE IN EXCEL

How To Delete Empty Rows With VBA 

Excel Open
Press Alt + F11 to open the visual basic editor
Goto Insert New Module
Copy the Code and Paste it in the new module.

Before

Before Using VBA Code

Delete Empty Rows Using VBA


After

After Using Code

VBA Delete Rows

Paste This Code


Sub DeleteEmptyRows()
   Dim i As Integer
   Dim LastRow As Long

   LastRow = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row

   Application.ScreenUpdating = False

   For i = LastRow to 1 Step -1
     If Application.WorksheetFunction.CountA(Rows(i)) = 0 Then
        Rows(i).Delete
     End If
   Next i

   Application.ScreenUpdating = True
End Sub
 

Watch Video For Easy Learning

 
 

INSERT CELL COLOR USING VBA IN EXCEL


INSERT CELL COLOR IN SPREADSHEET USING VBA EXCEL


If you want to insert cell color in your spreadsheet using VBA. We provide Very easy and understanding method to do it. Now open New blank workbook of Microsoft excel.

Goto Developer Tab on your ribbon and click visual basic button on left side.

Developer Tab In Excel

 Copy code and paste it on your visual basic window

Cell Color using VBA in Excel

Code

Sub Cell_Color()

Dim i As Integer

For i = 1 To 10
Cells(i, 1).Value = i
Cells(i, 2).Interior.ColorIndex = i
Next i

End Sub

After Run Macro you can see your spreadsheet like this

Insert Cell Colour Table in Excel using VBA

Easy Learning watch Video

HOW TO CREATE WELCOME MESSAGE WITH VOICE IN EXCEL USING VBA

VOICE WELCOME NOTE USING VBA IN EXCEL

How To Create Welcome Note In Excel With Voice VBA Code

If you want to create welcome note with voice in Excel msgbox when you open Excel file or users open Excel file. Its better option to create VBA code in Visual Basic Excel and do it easily. VBA Code is a most powerful tool to create powerful and secure sheets, workbooks and other as well as Excel Formulas.

Screen Shot 

Excel VBA Welcome Note In Excel

When we open Excel File Automatic File Show msgbox on Screen With Excel Admin Name.

How To Create MsgBox VBA  in Excel

Open your new Excel file. Goto Developer Tab and click Visual Basic and type or paste Excel VBA Code and save it. 

Shortcut Key Is Alt + F11


Input VBA In Excel Detail