how can make autosave in userform ?

mjdalmalti

New Member
Joined
Mar 11, 2022
Messages
9
Office Version
  1. 2016
Platform
  1. Windows
I have been searching, but didn't find anything about that ,I am trying to figure out if there is a way to autosave the input data from a textbox to the spreadsheet without the need of click a save button or keyboard
know its some hard but i have a hint maybe will help
when data entry enter the serial number it will seperate the last character and put it inside the next column so maybe if i make a condtin if column c fll then save data to file and empty textbox
hope u understand me :)

New Microsoft Excel Worksheet (2).xlsm
ABCDE
1noS.NLinenameTime
21 mjd nader3/28/2022 12:58
3245632289A2A2MAJD3/28/2022 13:33
4345632289A2A2MAJD3/28/2022 13:33
54952345A3A3MAJD3/28/2022 13:43
659563214588A1A1MAJD3/28/2022 13:50
76123456789a3a3majd3/28/2022 14:03
data
Cell Formulas
RangeFormula
C2:C7C2=RIGHT(B2,2)



VBA Code:
Private Sub CommandButton1_Click()
Dim lastrow As Long
lastrow = WorksheetFunction.CountA(Sheets("data").Range("A:A"))
Sheets("data").Cells(lastrow + 1, 1).Value = lastrow
Sheets("data").Cells(lastrow + 1, 2).Value = UserForm1.TextBox2.Value
Sheets("data").Cells(lastrow + 1, 4).Value = UserForm1.TextBox1.Value
Sheets("data").Cells(lastrow + 1, 5).Value = Now()


Private Sub CommandButton2_Click()

UserForm1.TextBox2.Value = ""
UserForm1.ComboBox1.Value = ""
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,214,924
Messages
6,122,294
Members
449,077
Latest member
Rkmenon

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