LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
chip_pyp
 
Posts: n/a
Default VLOOKUP in a macro??

What I'm trying to do with my macro is this. I have an input box where the
user will put in text, numbers, etc. The macro automatically puts that value
in the next empty row in coulmn A. But before it does that I want the macro
to search all the previous strings in column A to see if there is the same
value. And if there is I want it to prompt the user to another set of
questions.

The current macro looks like this and I'm trying to incorporate the above
with the entry1 string:

Public Sub getdata()
Dim nextrow As Long
Dim entry1 As String, entry2 As String, entry3 As String
Dim entry4 As String, entry5 As String

Do
nextrow = Range("A65536").End(xlUp).Row + 1

entry1 = InputBox("What is the HFC MAC?", "HFC")
If entry1 = "" Then Exit Sub

entry2 = InputBox("What kind of modem is it?")
If entry2 = "" Then entry2 = Cells(nextrow - 1, 2).Value

entry3 = InputBox("Where is the modem? Default is 'Shelved'")
If entry3 = "" Then entry3 = "Shevled"

entry4 = InputBox("What's the status of the modem: Renting, Purchased or
Pending. Default is 'Pending'")
If entry4 = "" Then entry4 = "Pending"

entry5 = InputBox("What is today's date?")
If entry5 = "" Then entry5 = Cells(nextrow - 1, 5).Value

Cells(nextrow, 1) = entry1
Cells(nextrow, 2) = entry2
Cells(nextrow, 3) = entry3
Cells(nextrow, 4) = entry4
Cells(nextrow, 5) = entry5
Loop

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing a simple macro Connie Martin Excel Worksheet Functions 5 November 29th 05 09:19 PM
Adding a Macro to a VLookup Function Wanda H. Excel Discussion (Misc queries) 1 August 16th 05 08:37 PM
macro with F9 Kenny Excel Discussion (Misc queries) 1 August 3rd 05 02:41 PM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


All times are GMT +1. The time now is 12:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"