drums4monty
03-02-2008, 03:09 AM
Hi
I have a work book with 4 sheets, Uniform Retail, Stationary and Search which is a database of stock or my work. I want to use VLOOKUP to find items I want, which I can do, but I want to write some code to bring up an Input Box to ask what I want to search, Uniform, Retail or Stationary and then ask for the Item to search for. I have created this code but it does not work, I know very, very little about coding macros etc, but I am trying. Can anyone help?
Sub Database()
Dim sSheet As String
Dim sItem As String
sSheet = InputBox("Enter Section:")
Sheets("sSheet").Select
If [B3] = Empty Then
' Cancel = True
[B3].Activate
sItem = InputBox("Enter Item:")
[B3] = sItem
End If
End Sub
Kind regards
Alan
I have a work book with 4 sheets, Uniform Retail, Stationary and Search which is a database of stock or my work. I want to use VLOOKUP to find items I want, which I can do, but I want to write some code to bring up an Input Box to ask what I want to search, Uniform, Retail or Stationary and then ask for the Item to search for. I have created this code but it does not work, I know very, very little about coding macros etc, but I am trying. Can anyone help?
Sub Database()
Dim sSheet As String
Dim sItem As String
sSheet = InputBox("Enter Section:")
Sheets("sSheet").Select
If [B3] = Empty Then
' Cancel = True
[B3].Activate
sItem = InputBox("Enter Item:")
[B3] = sItem
End If
End Sub
Kind regards
Alan