Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default Multiple inputs from "Input Box"

I want to get multiple entries to paste to another sheet. I have the
following input box working to request one entry. Can anyone tell me how to
use the same box for multiple requests to append to "Sheet1"? Also, if entry
is wrong, I need to just return them back to the input box.
Please forgive any mistakes, I just had brain surgery...Really!!

Market = Application.InputBox("Enter your market")

Sheets("Daily_info").Select
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=18, Criteria1:=Market, Operator:=xlAnd
Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
Sheets("Sheet1").Select
ActiveSheet.Paste

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 897
Default Multiple inputs from "Input Box"

Here's how I do it:

Dim ReportTime As String
Dim strDate As String
Dim strTime As String

ReportTime = InputBox("Enter date and time (24-hour time format):" &
vbCr & vbCr & "Ex: 8/1/2008 18:30 (for 6:30 pm).")

strDate = Left$(ReportTime, WorksheetFunction.Find(" ", ReportTime) -
1)
strTime = Right$(ReportTime, Len(ReportTime) -
WorksheetFunction.Find(" ", ReportTime))



After you run this, the two separate elements from the Inputbox are
stored in two string variables.

HTH,
JP

On Aug 11, 2:26*pm, Megadrone
wrote:
I want to get multiple entries to paste to another sheet. I have the
following input box working to request one entry. Can anyone tell me how to
use the same box for multiple requests to append to "Sheet1"? Also, if entry
is wrong, I need to just return them back to the input box.
Please forgive any mistakes, I just had brain surgery...Really!!

Market = Application.InputBox("Enter your market")

* * Sheets("Daily_info").Select
* * Range("A1").Select
* * Selection.AutoFilter
* * Selection.AutoFilter Field:=18, Criteria1:=Market, Operator:=xlAnd
* * Range("A1").Select
* * Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
* * Selection.Copy
* * Sheets("Sheet1").Select
* * ActiveSheet.Paste


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default Multiple inputs from "Input Box"

I do believe I was misunderstood, I want them to enter an item in the input
box (it is them pasted to Sheet1) then I want them to be able to return to
the input box and enter another item and so on. when they are finished I
want some way to end the input function.

"JP" wrote:

Here's how I do it:

Dim ReportTime As String
Dim strDate As String
Dim strTime As String

ReportTime = InputBox("Enter date and time (24-hour time format):" &
vbCr & vbCr & "Ex: 8/1/2008 18:30 (for 6:30 pm).")

strDate = Left$(ReportTime, WorksheetFunction.Find(" ", ReportTime) -
1)
strTime = Right$(ReportTime, Len(ReportTime) -
WorksheetFunction.Find(" ", ReportTime))



After you run this, the two separate elements from the Inputbox are
stored in two string variables.

HTH,
JP

On Aug 11, 2:26 pm, Megadrone
wrote:
I want to get multiple entries to paste to another sheet. I have the
following input box working to request one entry. Can anyone tell me how to
use the same box for multiple requests to append to "Sheet1"? Also, if entry
is wrong, I need to just return them back to the input box.
Please forgive any mistakes, I just had brain surgery...Really!!

Market = Application.InputBox("Enter your market")

Sheets("Daily_info").Select
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=18, Criteria1:=Market, Operator:=xlAnd
Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
Sheets("Sheet1").Select
ActiveSheet.Paste



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 897
Default Multiple inputs from "Input Box"

Inputbox returns "" when Cancel is pressed. Wrap the Inputbox in a Do
Loop that checks if the returned string is "", then you know the user
is finished. Otherwise it keeps looping and asking for more input. You
can also do simply data validation on the inputted string, for example
IsDate() to make sure the user entered a valid date. Anything more
complicated than that, an Inputbox is inadequate; you'd want to use a
userform.

Dim ReportTime As String
Dim strDate As String
Dim strTime As String

Do Until ReportTime = ""

ReportTime = InputBox("Enter date and time (24-hour time format):" &
vbCr & vbCr & "Ex: 8/1/2008 18:30 (for 6:30 pm).")

strDate = Left$(ReportTime, WorksheetFunction.Find(" ", ReportTime) -
1)
strTime = Right$(ReportTime, Len(ReportTime) -
WorksheetFunction.Find(" ", ReportTime))

Loop


On Aug 11, 3:06*pm, Megadrone
wrote:
I do believe I was misunderstood, I want them to enter an item in the input
box (it is them pasted to Sheet1) then I want them to be able to return to
the input box and enter another item and so on. *when they are finished I
want some way to end the input function.



"JP" wrote:
Here's how I do it:


Dim ReportTime As String
Dim strDate As String
Dim strTime As String


ReportTime = InputBox("Enter date and time (24-hour time format):" &
vbCr & vbCr & "Ex: *8/1/2008 18:30 (for 6:30 pm).")


strDate = Left$(ReportTime, WorksheetFunction.Find(" ", ReportTime) -
1)
strTime = Right$(ReportTime, Len(ReportTime) -
WorksheetFunction.Find(" ", ReportTime))


After you run this, the two separate elements from the Inputbox are
stored in two string variables.


HTH,
JP


On Aug 11, 2:26 pm, Megadrone
wrote:
I want to get multiple entries to paste to another sheet. I have the
following input box working to request one entry. Can anyone tell me how to
use the same box for multiple requests to append to "Sheet1"? Also, if entry
is wrong, I need to just return them back to the input box.
Please forgive any mistakes, I just had brain surgery...Really!!


Market = Application.InputBox("Enter your market")


* * Sheets("Daily_info").Select
* * Range("A1").Select
* * Selection.AutoFilter
* * Selection.AutoFilter Field:=18, Criteria1:=Market, Operator:=xlAnd
* * Range("A1").Select
* * Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
* * Selection.Copy
* * Sheets("Sheet1").Select
* * ActiveSheet.Paste- Hide quoted text -


- Show quoted text -


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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
"read" inputs past end of file Japazo88 Excel Discussion (Misc queries) 4 May 8th 08 03:41 PM
When I input "25:03" as a time, it reads "1:03" Darryl_Neeley Excel Discussion (Misc queries) 9 September 26th 07 09:20 PM
Multiple "source" workbooks linked to single "destination" workboo DAVEJAY Excel Worksheet Functions 1 September 17th 07 05:33 PM
Is there a function like "Data Table" for multiple Inputs [email protected] Excel Worksheet Functions 1 February 16th 06 02:59 AM


All times are GMT +1. The time now is 03:04 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"