User Form Question

Guzzlr

Well-known Member
Joined
Apr 20, 2009
Messages
946
Office Version
  1. 2016
Platform
  1. Windows
Hello All,
I'm having a little difficulty with learning about User Form's

My Code Thus Far:
Code:
 [COLOR=#339933]'While Loop Checks for Data Beginning In Line 17[/COLOR] 
RowCounter = 17
    While Cells(RowCounter, 2).Value <> ""
        RowCounter = RowCounter + 1
    Wend    
[COLOR=#339900]'Data Input Into Excel Sheet[/COLOR]
    Cells(RowCounter, 2).Value = Tbx_Date.Text
    Cells(RowCounter, 3).Value = Tbx_Time.Value

So, My User Form has two fields to fill in:
1. "Date Field"
2. "Time Field"

When I fill in the Date Field, the User Form enters the date in RANGE(B17), as it should, and continues with B18, B19 as new dates are entered. So the Date Field is working Correctly.

My "Time Field" is not working correctly. When I enter a number ie: 1.5, the code faults on:
Cells(RowCounter, 3).Value = Tbx_Time.Value

What I'm trying to accomplish, is the Date in B17 and the corresponding time in C18.

Thanks for the help
excel 2013

PS, at this time, I have no declarations, which is probably wrong...
 
Last edited:
I never click on links.

This is a simple little thing your wanting
I do not need to see a file or image
We have two textboxes here:
You said there names were:
Tbx_Time
Tbx_Date


Do you mean there names are:

"Date"
"Time"

If so those are not good names to be used.
 
Last edited:
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Code:
Cells(Lastrow, 3).Value = Tbx_Time.Value

What exactly does this line of code mean? Especially the "3"

Thanks
 
Upvote 0
I'm not seeing a Tbx Upper, just Tbx _Date and Tbx_Time
?
thanks
In the file that you supplied, if you select the lower of the 2 textboxes & look at the properties window you'll see that the Name says Tbx_Upper
 
Upvote 0
If means the value from you textbox will be entered in the last row with data plus one row the 3 means column (3)
Code:
Cells(Lastrow, 3).Value = Tbx_Time.Value

What exactly does this line of code mean? Especially the "3"

Thanks
 
Upvote 0
In the file that you supplied, if you select the lower of the 2 textboxes & look at the properties window you'll see that the Name says Tbx_Upper

Oh...Now it Works, Thank you!
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0
One more question..

How do i get the the top left corner of the user form to show on F2?
Thanks
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,582
Members
449,089
Latest member
Motoracer88

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