Getting data into a cell

Closed
Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
I have a VBA Form which gets data from a row on the selection of a name in a dropdown (name is from dynamic range). I would then like the data on clicking 'OK' to be updated for that row but I can't seem to get the information from the controls to update their respective cells!
The code:
'-------------------------------------------------------------------------
'UPDATE CLIENT DETAILS
'-------------------------------------------------------------------------
Private Sub CommandOK1_Click()
ActiveWorkbook.Sheets("CLIENT_SHEET").Activate
'-------------------------------------------------------------------------
'Client Details Update
'-------------------------------------------------------------------------
Cells(SelLine, 2).Select
ActiveCell.Value = CmbCLIENTNAME.Value
ActiveCell.Offset(0, 1) = TxtADRESS.Value
ActiveCell.Offset(0, 2) = TxtPOSTCODE.Value
ActiveCell.Offset(0, 3) = CmbGENDER.Value
ActiveCell.Offset(0, 4) = CmbSEX.Value
ActiveCell.Offset(0, 5) = TxtDOB.Value
ActiveCell.Offset(0, 6) = CmbETHNIC.Value
If OptBPREGNO = True Then
ActiveCell.Offset(0, 7).Value = "0"
ElseIf OptBPREGYES = True Then
ActiveCell.Offset(0, 7).Value = "1"
Else
ActiveCell.Offset(0, 7).Value = ""
End If

what appears is the data that was already there, not the updated values from the form - the Option buttons do seem to work ok??

Help would be appreciated.



1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Could you please upload a sample file on some shared site like https://authentification.site and post back here the link to allow better understanding of how it is now and how you foresee.
0