mjdalmalti
New Member
- Joined
- Mar 11, 2022
- Messages
- 9
- Office Version
- 2016
- Platform
- 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
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 | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | no | S.N | Line | name | Time | ||
2 | 1 | mjd nader | 3/28/2022 12:58 | ||||
3 | 2 | 45632289A2 | A2 | MAJD | 3/28/2022 13:33 | ||
4 | 3 | 45632289A2 | A2 | MAJD | 3/28/2022 13:33 | ||
5 | 4 | 952345A3 | A3 | MAJD | 3/28/2022 13:43 | ||
6 | 5 | 9563214588A1 | A1 | MAJD | 3/28/2022 13:50 | ||
7 | 6 | 123456789a3 | a3 | majd | 3/28/2022 14:03 | ||
data |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C2:C7 | C2 | =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 = ""