Masta
New Member
- Joined
- Feb 22, 2022
- Messages
- 33
- Office Version
- 2021
- 2019
- 2016
- Platform
- Windows
I have one problem and i don't know how to work around that, so i need help.
Private Sub CommandButton42_Click()
TextBox47.Value = TextBox47.Value & TextBox6.Value
TextBox6.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
Sheets("Baza").Range("A1").Value = Sheets("Baza").Range("A1").Value + 1 'Generisanje rednog broja 'Generate a new ordinal number
TextBox46.Text = Sheets("Baza").Range("A1") 'Generisanje rednog broja 'Generate a new ordinal number
TextBox2.BackColor = RGB(240, 240, 240) 'Bela
TextBox3.BackColor = RGB(240, 240, 240) 'Bela
End Sub
The problem is when I don't have data in TextBox6 when I click to execute the command a new number is generated and I don't want that to happen when there is no data in TexBox6, I want the number to be generated only when data is present in TexBox6 and needs to be copied to TextBox47. Otherwise, the ordinal number is generated in TextBox46 only when there is a condition for it. Thanks for the help if you know how to help me.
Private Sub CommandButton42_Click()
TextBox47.Value = TextBox47.Value & TextBox6.Value
TextBox6.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
Sheets("Baza").Range("A1").Value = Sheets("Baza").Range("A1").Value + 1 'Generisanje rednog broja 'Generate a new ordinal number
TextBox46.Text = Sheets("Baza").Range("A1") 'Generisanje rednog broja 'Generate a new ordinal number
TextBox2.BackColor = RGB(240, 240, 240) 'Bela
TextBox3.BackColor = RGB(240, 240, 240) 'Bela
End Sub
The problem is when I don't have data in TextBox6 when I click to execute the command a new number is generated and I don't want that to happen when there is no data in TexBox6, I want the number to be generated only when data is present in TexBox6 and needs to be copied to TextBox47. Otherwise, the ordinal number is generated in TextBox46 only when there is a condition for it. Thanks for the help if you know how to help me.