I need help with this portion of my spreadsheet and userform and no better place than here to get it.
I am wanting anytime any cell is selected in a given row (range myLEDGER, actually A19:AR71), a userform pops up (1st code). I figure I need to Offset back to A somehow and then Offset back to the other ranges from there once I was in the userform to set the ranges)
When that form pops up I need it to show the values in the corresponding cells of the row that was selected.
Data is in the columns below
A (A and B are merged) (would = txtDate in userform)
C (C-E are merged) - (would = txtSTART in userform)
F (F-H are merged) - (would = txtEND in userform)
I (I and J are merged) - (would = txtHOURS in userform)
K (K-AH are merged) - (would = txtDETAILS in userform)
AO (AO-AP are merged) (would = txtCREW in userform)
AQ (AQ-AR are merged) - (would = txtINT in userform)
If the user changed anything and clicks the update button provided, I need those values to go back to the data ranges above.
Below (2nd and 3rd code) is what I have so far for opening the userform and executing the update command button) but it just isn’t working for me.
Hopefully this explains it well enough. Please feel free to ask any questions and I am open to any suggestions.
BT
I am wanting anytime any cell is selected in a given row (range myLEDGER, actually A19:AR71), a userform pops up (1st code). I figure I need to Offset back to A somehow and then Offset back to the other ranges from there once I was in the userform to set the ranges)
When that form pops up I need it to show the values in the corresponding cells of the row that was selected.
Data is in the columns below
A (A and B are merged) (would = txtDate in userform)
C (C-E are merged) - (would = txtSTART in userform)
F (F-H are merged) - (would = txtEND in userform)
I (I and J are merged) - (would = txtHOURS in userform)
K (K-AH are merged) - (would = txtDETAILS in userform)
AO (AO-AP are merged) (would = txtCREW in userform)
AQ (AQ-AR are merged) - (would = txtINT in userform)
If the user changed anything and clicks the update button provided, I need those values to go back to the data ranges above.
Below (2nd and 3rd code) is what I have so far for opening the userform and executing the update command button) but it just isn’t working for me.
Hopefully this explains it well enough. Please feel free to ask any questions and I am open to any suggestions.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(Target, Range("k19")) Is Nothing Then ' this will be myLEDGER but I have been trying with just one cell to get it to work
ActiveCell.Offset(0, -10).Activate
End If
End Sub
Code:
Private Sub UserForm_Initialize()
Dim DateRNG As Range, StartRNG As Range, EndRNG As Range, TypeHrRNG As Range, DetailRNG As Range, CrewRNG As Range, IntRNG As Range
txtDATE.Text = Format(txtDATE.Text, "dd mmm yyyy")
txtSTART.Text = Format(txtSTART.Text, "hh:mm AM/PM")
txtEND.Text = Format(txtEND.Text, "hh:mm AM/PM")
Set DateRNG = ActiveCell
Set StartRNG = ActiveCell.Offset(0, 2)
Set EndRNG = ActiveCell.Offset(0, 5)
Set TypeHrRNG = ActiveCell.Offset(0, 8)
Set DetailRNG = ActiveCell.Offset(0, 10)
Set CrewRNG = ActiveCell.Offset(0, 40)
Set IntRNG = ActiveCell.Offset(0, 42)
txtDATE = DateRNG.Value
txtSTART = StartRNG.Value
txtEND = EndRNG.Value
txtHOURS = TypeHrRNG.Value
txtDETAILS = DetailRNG.Value
txtCREW = CrewRNG.Value
txtINT = IntRNG.Value
End Sub
Code:
Private Sub CommandButton3_Click()
Dim DateRNG As Range, StartRNG As Range, EndRNG As Range, TypeHrRNG As Range, DetailRNG As Range, IntRNG As Range
Dim myRNG As Range
Set myRNG = ActiveCell
Set DateRNG = ActiveCell
Set StartRNG = ActiveCell.Offset(0, 2)
Set EndRNG = ActiveCell.Offset(0, 5)
Set TypeHrRNG = ActiveCell.Offset(0, 8)
Set DetailRNG = ActiveCell.Offset(0, 10)
Set CrewRNG = ActiveCell.Offset(0, 40)
Set IntRNG = ActiveCell.Offset(0, 42)
myRNG = txtDATE.Value
StartRNG = txtSTART.Value
EndRNG = txtEND.Value
TypeHrRNG = txtHOURS.Value
DetailRNG = txtDETAILS.Value
IntRNG = txtINT.Value
Unload me
End Sub
BT