NateW
12-06-2007, 09:55 AM
Hi, Folks...
I'm trying to create a macro where the user can put their cursor anywhere within a row, and then click a button which will populate various information on that row.
I'm trying to use the activecell property to get information into the macro to tell it what row to put the information on. Please see the following code:
Sub EmptyReturnStamp()
Dim focusCell, targetRow As String
focusCell = ActiveCell.Value 'gets the value of the active cell
targetRow = Mid(focusCell, 2, 4) 'pulls the row information from the cell reference
Sheets("Gate Control").Cells(targetRow, 3) = "RETOUR BOUTEILLES VIDES"
End Sub
When I do this, I get a mismatch error on the last line of code (before End Sub), and when I hover over the variables, nothing is being stored in focusCell.
Any suggestions?
Thanks!!!! :)
I'm trying to create a macro where the user can put their cursor anywhere within a row, and then click a button which will populate various information on that row.
I'm trying to use the activecell property to get information into the macro to tell it what row to put the information on. Please see the following code:
Sub EmptyReturnStamp()
Dim focusCell, targetRow As String
focusCell = ActiveCell.Value 'gets the value of the active cell
targetRow = Mid(focusCell, 2, 4) 'pulls the row information from the cell reference
Sheets("Gate Control").Cells(targetRow, 3) = "RETOUR BOUTEILLES VIDES"
End Sub
When I do this, I get a mismatch error on the last line of code (before End Sub), and when I hover over the variables, nothing is being stored in focusCell.
Any suggestions?
Thanks!!!! :)