Claire_Brummell
Board Regular
- Joined
- Sep 29, 2004
- Messages
- 129
Hey,
Trying to get a simple sub written.
- When it's run I need to record the value of the active cell.
- It then needs to check to see if I want to make this a 'key channel'
- If the answer's yes I want it to cycle through all the rows making the K column = 1 if the A column equals the value of the initial active cell.
This is the sub:
But I'm getting an object required error on the first line after my variable decs - any ideas?
Trying to get a simple sub written.
- When it's run I need to record the value of the active cell.
- It then needs to check to see if I want to make this a 'key channel'
- If the answer's yes I want it to cycle through all the rows making the K column = 1 if the A column equals the value of the initial active cell.
This is the sub:
Code:
Sub Set_Key_Channel()
Dim current_row As Long
Dim new_key_channel As String
new_key_channel = Active_Cell.Value
Response = MsgBox("Do you want to set " & new_key_channel & " as a key channel for " & ActiveSheet.Name & "?", vbYesNo)
If Response = vbYes Then
For current_row = 2 To ActiveSheet.Rows.Count
If Cells(current_row, 1) = new_key_channel Then
Cells(current_row, 11) = "1"
End If
Next current_row
Else
End If
End Sub
But I'm getting an object required error on the first line after my variable decs - any ideas?