Snake Eyes
Board Regular
- Joined
- Dec 14, 2010
- Messages
- 103
- Office Version
- 365
- 2016
- Platform
- Windows
I have a macro that allows me to select and entire row:
With this macro I will be copying the selected row to other sheets however, one thing I need to do is select a certain range of cells in the entered row and then clear contents of that range.
These are the cells I would like to work into the code above in order to select them:
A:D,K,L,O:Q,T,U
How would I work these into the code above?
Excel Formula:
Sub Select_Specific_Row()
Dim Row As String
Dim rng As Range
StartHere:
Row = InputBox("Enter Row Number to Select.", "Select Row")
If Row = "" Then Exit Sub
On Error Resume Next
' if not a valid range, an error occurs
Set rng = ActiveSheet.Rows(Row)
If Err.Number <> 0 Then
On Error GoTo 0
Err.Clear
MsgBox "Invalid input! Please input a valid column."
GoTo StartHere
End If
rng.EntireRow.Select = True
MsgBox "Row" & UCase(Row) & "is now Selected.", _
vbOKOnly, "Select Specified Row"
Set rng = Nothing
On Error GoTo 0
End Sub
With this macro I will be copying the selected row to other sheets however, one thing I need to do is select a certain range of cells in the entered row and then clear contents of that range.
These are the cells I would like to work into the code above in order to select them:
A:D,K,L,O:Q,T,U
How would I work these into the code above?