I am trying to write a macro to achieve the following:
-the user highlights the row in the worksheet that they wish to use and clicks the command button to start the macro
-the macro copies specific cells from the highlighted row and then pastes just these cells to another worksheet in the same workbook. The destination worksheet is not the same format as the worksheet I am copying from, so each cell will have to be pasted individually.
Here is what I have so far:
If Not IsEmpty(Selection.Value) Then
'produce a message box just to see if macro is running
MsgBox "Macro is running."
'put code here to copy the row that the user highlights
'also code to paste only specific cells to another worksheet
Else
'if the user has not highlighted a row
MsgBox "Please select a week to process."
End If
What is happening now is that the "Macro is running." message box pops up when I click the command button, even though the user has not selected any text yet.
How do I change my code to achieve the results I want?
Thanks.
-the user highlights the row in the worksheet that they wish to use and clicks the command button to start the macro
-the macro copies specific cells from the highlighted row and then pastes just these cells to another worksheet in the same workbook. The destination worksheet is not the same format as the worksheet I am copying from, so each cell will have to be pasted individually.
Here is what I have so far:
If Not IsEmpty(Selection.Value) Then
'produce a message box just to see if macro is running
MsgBox "Macro is running."
'put code here to copy the row that the user highlights
'also code to paste only specific cells to another worksheet
Else
'if the user has not highlighted a row
MsgBox "Please select a week to process."
End If
What is happening now is that the "Macro is running." message box pops up when I click the command button, even though the user has not selected any text yet.
How do I change my code to achieve the results I want?
Thanks.