bigbertha98
New Member
- Joined
- Jan 2, 2019
- Messages
- 2
I am having a bit of a headache and I've found this forum very useful in the past however I can't find a clear answer for this one anywhere. Apologies I am a novice at this so please bear with me.
I have put together a userform and a spreadsheet for it to be uploaded into. The problem I have is I want the data in the userform to look at the date in a textbox and find the corresponding row where that date occurs. Then I want it to upload the data into that row and for this all to be done on the click of a command button.
The spreadsheet has a list of dates in column A between A3 and A370 going from 01/04/18 to 31/03/19 (one date per day)
The code needs to look in this range, find the date and upload the data held in the userform into that specific row.
Unfortunately due to admin restrictions I am unable to upload an screenshots which would make it much easier
Here is the Sub I’m working with and I can’t join the search and upload elements
I have put together a userform and a spreadsheet for it to be uploaded into. The problem I have is I want the data in the userform to look at the date in a textbox and find the corresponding row where that date occurs. Then I want it to upload the data into that row and for this all to be done on the click of a command button.
The spreadsheet has a list of dates in column A between A3 and A370 going from 01/04/18 to 31/03/19 (one date per day)
The code needs to look in this range, find the date and upload the data held in the userform into that specific row.
Unfortunately due to admin restrictions I am unable to upload an screenshots which would make it much easier
Here is the Sub I’m working with and I can’t join the search and upload elements
Code:
Sub Dataentry()
Dim Found As Range
Set Found = Sheets("CST Productivity").Range("A3:A370").Find(What:=Me.TextBox17.Value, _
LookIn:=xlValues, _
LookAt:=xlByRows, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Found Is Nothing Then
MsgBox "Date Not Present on Tracker"
'Exit Sub
Else: Found.Select
End If
''Dim wb As Workbook
''Set wb = ThisWorkbook
''Dim ws As Worksheet
''Dim NextRow As Long
''Set ws = wb.Sheets("CST Productivity")
''NextRow = ws.Range("B" & Rows.Count).End(xlUp).Row + 1
'With Sheets("CST Productivity")
'NextRow = .Range("B" & Rows.Count).End(xlUp).Row + 1
'
'
''CST1:
'.Range("B" & NextRow) = 7.4
'.Range("B" & NextRow).Offset(0, 1).Value = UserForm1.TextBox98.Value
'.Range("B" & NextRow).Offset(0, 2).Value = UserForm1.TextBox147.Value
'.Range("B" & NextRow).Offset(0, 3).Value = UserForm1.TextBox146.Value
'.Range("B" & NextRow).Offset(0, 4).Value = UserForm1.TextBox148.Value
'.Range("B" & NextRow).Offset(0, 5).Value = UserForm1.TextBox114.Value
'.Range("B" & NextRow).Offset(0, 6).Value = UserForm1.TextBox66.Value
'.Range("B" & NextRow).Offset(0, 7).Value = UserForm1.TextBox82.Value
'.Range("B" & NextRow).Offset(0, 8).Value = UserForm1.ComboBox95.Text
'.Range("B" & NextRow).Offset(0, 9).Value = UserForm1.ComboBox1.Text
'.Range("B" & NextRow).Offset(0, 10).Value = UserForm1.ComboBox18.Text
'.Range("B" & NextRow).Offset(0, 11).Value = UserForm1.TextBox130.Text
'.Range("B" & NextRow).Offset(0, 12).Value = UserForm1.ComboBox33.Text
'.Range("B" & NextRow).Offset(0, 13).Value = UserForm1.ComboBox79.Text
'.Range("B" & NextRow).Offset(0, 14).Value = UserForm1.TextBox269.Text
Last edited by a moderator: