I found a code online that works when done manually, but there is one little bit of it I'd prefer to change but I can't figure out what to remove to make it work. I've tried to study the code but to no avail. I've tried to break it down and see what works and what doesn't, but it breaks it.
Please help.
I want to remove the input box that asks what cell range I am wanting to select and basically ask it to select column CC (entire column that is) automatically without me needing to select it every time.
I imagine I am going to look silly but it really would be much appreciated.
Please help.
I want to remove the input box that asks what cell range I am wanting to select and basically ask it to select column CC (entire column that is) automatically without me needing to select it every time.
I imagine I am going to look silly but it really would be much appreciated.
VBA Code:
Sub SelectCellsWithData()
Dim bCell As Range
Set myRange = Application.Selection
Set myRange = Application.InputBox("choose one range that you want to select:", "SelectCellsWithData", myRange.Address, Type:=8)
For Each myCell In myRange
If myCell.Value <> "" Then
If bCell Is Nothing Then
Set bCell = myCell
Else
Set bCell = Union(bCell, myCell)
End If
End If
Next
If Not bCell Is Nothing Then
bCell.Select
End If
End Sub