Writing data to certain line from a textbox based on the value

kevinc1973

New Member
Joined
Jun 20, 2019
Messages
22
Hello everyone,
I have a spreadsheet that the rows are labeled 1-31 and data gets entered into it every night at midnight and then the sheet gets saved at the end of each month and a new is started. I want to make a user form and have text box 1 automatically have today's date generated when opened ( i am good with doing this so far). When i add data I want it to go to that line that matches the date. for example textbox 1 has a date of 6/15/2019 then the userform data will write to line 15 (lets say 15 is actually row 18). If someone forgets to enter data on night it will skip that line and make it easier to fix sheet at end of month.
Thanks for any input
Kevin
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
@kevinc1973

Assuming your data to be the text of Textbox2 and the receiving column to be C (edit to suit) then, at the point in your code where you wish to commit the data, along the lines of.....

Code:
ActiveSheet.Range("C" & Day(Now) + 3) = TextBox2.Text

Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,161
Members
453,021
Latest member
Justyna P

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