Answers for "select range in excel vba from selected cell"

VBA
5

excel vba get user selected range

MsgBox Selection.Address
Posted by: Guest on April-04-2020
0

count number of cell ina range vba

Sub DisplayColumnCount() 
    Dim iAreaCount As Integer 
    Dim i As Integer 
 
    Worksheets("Sheet1").Activate 
    iAreaCount = Selection.Areas.Count 
 
    If iAreaCount <= 1 Then 
        MsgBox "The selection contains " & Selection.Columns.Count & " columns." 
    Else 
        For i = 1 To iAreaCount 
            MsgBox "Area " & i & " of the selection contains " & _ 
            Selection.Areas(i).Columns.Count & " columns." 
        Next i 
    End If 
End Sub
Posted by: Guest on June-18-2020

Code answers related to "select range in excel vba from selected cell"

Code answers related to "VBA"

Browse Popular Code Answers by Language