B
Bob Holmes
I'm using a worksheet as a front-end for some data entry. I have code in
the 'worksheet_selectionchange' event that enables/disables command buttons
and comboboxes on the sheet based on the column in which the user places the
cursor. I am finding that after selecting some cells for copying, that the
selection goes away as soon as I reach code in this event that is related to
the command button or any object on the worksheet, which means that there is
nothing to paste.
Here is a sample of my code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If blnSaving = True Then Call Check_Existing_Codes(Target)
cmbNewWorkCode.Visible = False
'more code here
End Sub
I select cells, choose to copy the selection and then select the cell where
it should paste. Upon selecting the cell for pasting, this routine is
triggered and the first line causes no problems since it is only checking
the value of a variable. Upon execution of the second line, the selection
disappears and the paste feature is disabled.
I'm certain that this is where I need to place this code, since I need to
know as soon as the user has selected a cell in order to determine where the
cursor is. Is there some way to maintain the selection even though the code
is working on objects on the sheet. Does anyone have any suggestions. I'm
willing to try anything. Thanks for any help you can offer.
the 'worksheet_selectionchange' event that enables/disables command buttons
and comboboxes on the sheet based on the column in which the user places the
cursor. I am finding that after selecting some cells for copying, that the
selection goes away as soon as I reach code in this event that is related to
the command button or any object on the worksheet, which means that there is
nothing to paste.
Here is a sample of my code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If blnSaving = True Then Call Check_Existing_Codes(Target)
cmbNewWorkCode.Visible = False
'more code here
End Sub
I select cells, choose to copy the selection and then select the cell where
it should paste. Upon selecting the cell for pasting, this routine is
triggered and the first line causes no problems since it is only checking
the value of a variable. Upon execution of the second line, the selection
disappears and the paste feature is disabled.
I'm certain that this is where I need to place this code, since I need to
know as soon as the user has selected a cell in order to determine where the
cursor is. Is there some way to maintain the selection even though the code
is working on objects on the sheet. Does anyone have any suggestions. I'm
willing to try anything. Thanks for any help you can offer.