Excel Userform VBA - Value from Last Textbox not showing

cdub27455

New Member
Joined
Mar 22, 2022
Messages
5
Office Version
  1. 2016
Platform
  1. Windows
Good morning!

I have created two user forms in VBA, one that enters "Sample Details" and creates a new sample number, then another that allows the user to edit and enter testing data for the sample. However, I'm having an issue with one textbox not populating the value from the text box into the sheet at all even though all the others seem to work fine. I've checked the code, the textbox settings, and the cell format, but no success. Please see screenshots and code below. Thanks in advance!!

VBA Code:
Dim TargetRow As Integer 'variable for position control

TargetRow = Sheets("Engine").Range("B5").Value 'make variable equal to COUNTA formula on worksheet

'''BEGIN ATTERBERG INFORMATION'''

Sheets("Data").Range("Data_Start").Offset(TargetRow, 26).Value = LLCupNoText
Sheets("Data").Range("Data_Start").Offset(TargetRow, 27).Value = LLCupWeightText
Sheets("Data").Range("Data_Start").Offset(TargetRow, 28).Value = LLWetWeightText
Sheets("Data").Range("Data_Start").Offset(TargetRow, 29).Value = LLDryWeightText
Sheets("Data").Range("Data_Start").Offset(TargetRow, 30).Value = LLBlowsText
Sheets("Data").Range("Data_Start").Offset(TargetRow, 31).Value = PLCupNoText
Sheets("Data").Range("Data_Start").Offset(TargetRow, 32).Value = PLCupWeightText
Sheets("Data").Range("Data_Start").Offset(TargetRow, 33).Value = PLWetWeightText
Sheets("Data").Range("Data_Start").Offset(TargetRow, 34).Value = PLDryWeightText

'''END ATTERBERG INFORMATION'''



Images Below:

Screenshot of Userform with textbox issue/value circled

UserformScreenshot.jpg



Screenshot of spreadsheet where value should have been placed (notice the other values worked fine)

I have the numbers listed in row 5 as more of a reference for me. They indicate the column offset for the value location.

Userform_ValueLocation.jpg


Screenshot of Textbox Properties (tried a screenshot encompassing form too, but image was too large)

Userform_TextBoxProperties.jpg

 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Also, here is a screen shot of the "Engine" sheet referenced, in case it is needed.

Userform_EngineSheet.jpg
 
Upvote 0
Update:

I've continued working and found that this is occurring on every page (multipage userform). The last value from each page is not populating.
 
Upvote 0
Hi, with a complex project its helpful to forum if you can place copy of your workbook with sample data in a file sharing site like dropbox & provide a link to it.

Dave
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top