ganesh_6663
New Member
- Joined
- Jul 15, 2021
- Messages
- 33
- Office Version
- 2016
- Platform
- Windows
Hi Team,
Need to get data from hide worksheet in userform text boxes with vba using Vlookup application from DATABASE worksheet which is hiden while Useform is open..
When their is multiple excel file open to userform not getting data from DATABASE worksheet , tool giving error data not found .
After disable Application.Visible , tool working properly .
Help me to get data from hiden worksheet DATABASE while userform is active .
TOOL DOWNLOAD LINK.............
Code use to show and hide worksheet/userform , After disable this tool working properly.
Code user to get data in textbox using vlookup after clicking button
Getting following error while worksheet is hiden and try to click on "Click here 1st Gedata From SER ID"
Need to get data from hide worksheet in userform text boxes with vba using Vlookup application from DATABASE worksheet which is hiden while Useform is open..
When their is multiple excel file open to userform not getting data from DATABASE worksheet , tool giving error data not found .
After disable Application.Visible , tool working properly .
Help me to get data from hiden worksheet DATABASE while userform is active .
TOOL DOWNLOAD LINK.............
Code use to show and hide worksheet/userform , After disable this tool working properly.
VBA Code:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Application.Visible = True
Windows("Upload.xlsm").Visible = True
UserForm1.Hide
End Sub
VBA Code:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Application.Visible = True
Windows("Upload.xlsm").Visible = True
UserForm1.Hide
End Sub
Code user to get data in textbox using vlookup after clicking button
VBA Code:
Private Sub CommandButton5_Click()
'Error for get data button******************
If Reg1.Value = "" Then
MsgBox ("Please Enter SERVER ID & Then click on Getdata")
'Me.Reg1.Value = ""
Exit Sub
End If
'On Error GoTo myerror
On Error Resume Next
If WorksheetFunction.CountIf(Sheets("DATABASE").Range("A:A"), Me.Reg1.Value) = 0 Then
MsgBox ("Given SERVER ID not present in Macro Database")
'Me.Reg1.Value = ""
Exit Sub
End If
Reg2.Value = Application.VLookup(Reg1.Value, Sheets("DATABASE").Range("A2:F199191"), 6, 0)
Reg3.Value = Application.VLookup(Reg1.Value, Sheets("DATABASE").Range("A2:E199191"), 5, 0)
Reg4.Value = Application.VLookup(Reg1.Value, Sheets("DATABASE").Range("A2:H199191"), 8, 0)
Reg5.Value = Application.VLookup(Reg1.Value, Sheets("DATABASE").Range("A2:N199191"), 14, 0)
Reg6.Value = Application.VLookup(Reg1.Value, Sheets("DATABASE").Range("A2:K199191"), 11, 0)
TextBox6.Value = Application.VLookup(Reg1.Value, Sheets("DATABASE").Range("A2:M199191"), 13, 0)
TextBox4.Value = Application.VLookup(Reg1.Value, Sheets("DATABASE").Range("A2:Q199191"), 17, 0)
UserForm1.Reg1.SetFocus
End Sub
Getting following error while worksheet is hiden and try to click on "Click here 1st Gedata From SER ID"