Userform to Enter NOW() into Correct Cell in Table

boxface

New Member
Joined
Dec 22, 2016
Messages
8
I've got a table with Column C being a product number. I want to make a userform for applying a completed time to the product number (in column J).

I've made the userform, but I'm lost when it comes to the code. I've got a text box in which to enter the product number and an Okay button.

If it helps the text box is called txtProductNumber and the Okay button is called cmdAdd.

If I enter say 456789 into the product number field, how do I get this to then enter =NOW() into the date column on the same row? For example, if the product number 456789 appears in this table in cell C56, how do have this userform enter =NOW() in cell J56?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
You can use this line of code in your CommandButton's Click event...

Columns("C").Find(txtProductNumber.Value, , xlValues, xlWhole).Offset(, 7) = Now

But you will need some kind of error trap in case the user enters an invalid product number.
 
Upvote 0

Forum statistics

Threads
1,203,756
Messages
6,057,175
Members
444,911
Latest member
Uncommon1

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