#1   Report Post  
Posted to microsoft.public.excel.misc
chip_pyp
 
Posts: n/a
Default macro help

I wrote a macro that calls for input from the user. the macro aska series of
4 questions and then inserts them in the next available row. I need my macro
to look for the value input from the user on the first question. basically
the first question will ask what is your hfc number, i want the macro to then
search the sheet in column a for that value, if that val;ue is not in there
then it will proceed witht he rest,however if the macro finds that same
number then i want it to go to a serises of different questions to change the
information to th previous hfc. is there an "if" function of some nature to
do such a thing?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Patricia Shannon
 
Posts: n/a
Default macro help

Some detail from the macro would be helpful. How do you get the info from
the user? Inputbox?
Are you familiar with the "If" statement in Visual Basic? If not, use
Visual Basic Help. Also, look at "Select Case".

"chip_pyp" wrote:

I wrote a macro that calls for input from the user. the macro aska series of
4 questions and then inserts them in the next available row. I need my macro
to look for the value input from the user on the first question. basically
the first question will ask what is your hfc number, i want the macro to then
search the sheet in column a for that value, if that val;ue is not in there
then it will proceed witht he rest,however if the macro finds that same
number then i want it to go to a serises of different questions to change the
information to th previous hfc. is there an "if" function of some nature to
do such a thing?

  #3   Report Post  
Posted to microsoft.public.excel.misc
chip_pyp
 
Posts: n/a
Default macro help

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

Do
nextrow = Range("A65536").End(xlUp).Row + 1
entry1 = InputBox("What is the HFC MAC?")
If entry1 = "" Then Exit Sub
entry2 = InputBox("What kind of modem is it?")
If entry2 = "" Then Exit Sub
entry3 = InputBox("Where is the modem?")
If entry3 = "" Then entry3 = "Shevled"
entry4 = InputBox("What's the status of the modem: Renting, Purchased or
Pending")
If entry4 = "" Then entry4 = "Pending"
Cells(nextrow, 1) = entry1
Cells(nextrow, 2) = entry2
Cells(nextrow, 3) = entry3
Cells(nextrow, 4) = entry4
Loop

End Sub

thats what the macro looks like...after the user inputs the adata collected
for entry1 i want the macro to search the previous entries for that one then
promt other questions but if its not in there then is will insert the data to
the next empty row
Reply
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
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 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 05:36 PM.

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"