tommyleinen
Board Regular
- Joined
- Aug 22, 2009
- Messages
- 74
Wondering if anyone can help. I need help to create a macro for putting an "x" value into the visible cells i've filtered on a column.
Since the column may not be the same on each sheet I'd like a pop up message to ask Yes or No to ask if the correct cell is selected at the top of the column.
Here is what I have so far:
Sub addxtovisiblecells()
'put cursor in top cell of range before running this
ans = MsgBox("Is the correct cell selected?", vbYesNo)
If ans = vbYes Then
'Yes your code here
Selection.Value = "x"
ActiveCell.Copy
ActiveCell.Offset(0, 1).Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, -1).Select
Range.ActiveCell.End(xlUp).Select
ActiveRange.PasteSpecial Paste:=xlPasteValues
Else
End Sub
End If
End Sub
Any help would be much appreciated
Thanks
Since the column may not be the same on each sheet I'd like a pop up message to ask Yes or No to ask if the correct cell is selected at the top of the column.
Here is what I have so far:
Sub addxtovisiblecells()
'put cursor in top cell of range before running this
ans = MsgBox("Is the correct cell selected?", vbYesNo)
If ans = vbYes Then
'Yes your code here
Selection.Value = "x"
ActiveCell.Copy
ActiveCell.Offset(0, 1).Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, -1).Select
Range.ActiveCell.End(xlUp).Select
ActiveRange.PasteSpecial Paste:=xlPasteValues
Else
End Sub
End If
End Sub
Any help would be much appreciated
Thanks