InputBox Matche A Name In Column
Nov 6, 2008
I am using this code to delete cells from a spreadsheet if the employee name entered in the InputBox matches a name in column D. Does anyone know how I can amend the code so that if the user enters a misspelled name for example, there will be a message box warning ("Invalid Name Entered!"), which the user can press OK and return to the Input Box and try again.
Sub deleter()
Sheets("Staff").Select
Dim Name
Name = Application.InputBox("Please enter employee name", "Staff Termination")
If Name = "" Then
MsgBox "No name entered"
If Name = False Then
End If................................
View 9 Replies
ADVERTISEMENT
Jul 10, 2009
In cell C8, I need a formula that finds and matches the values in C5:BF5 on this worksheet with the values in Col's D:I on worksheet 1, if a match is found return the draw number,if no match, return a blank. In Cell C9, I need a formula that counts the number of draws since the number in C5 has appeared.
2. In Cell C10 find the draw number for the second appearance. In C11 the number of draws between first and second appearance.
I realize, I'm asking for alot, but if this can be done, I would greatly appreciate it. The values in the cells are the expected returns.
******** ******************** ************************************************************************>Microsoft Excel - MM_Example_File CONVERTED.xlsx___Running: 12.0 : OS = Windows XP (F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)boutA5=ABCD5White Ball Number 126Current Draw # 7Picked in this draw? 8Drawn #'s 1st Appearance? 3844089GAP Between Appearances 381410Drawn #'s 2nd Appearance? 382396GAP Figures [HtmlMaker 2.42] To see the formula in the cells just click on the cells hyperlink or click the Name boxPLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.
First Worksheet
******** ******************** ************************************************************************>Microsoft Excel - MM_Example_File CONVERTED.xlsx___Running: 12.0 : OS = Windows XP (F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)boutA5=ABCD5White Ball Number 126Current Draw # 7Picked in this draw? 8Drawn #'s 1st Appearance? 3844089GAP Between Appearances 381410Drawn #'s 2nd Appearance? 382396GAP Figures [HtmlMaker 2.42] To see the formula in the cells just click on the cells hyperlink or click the Name boxPLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.
View 12 Replies
View Related
Jun 30, 2009
I have the inputbox so i can set a string value,
When the inputbox Cancle button is pressed i want to exit sub,
If the inputbox value is nothink and ok button, I want the msgbox displayed then goto newname.
If the inputbox has a value do >>>>>>That>>>>>
View 6 Replies
View Related
May 5, 2014
I want to set the column to search using Find in second code below.
Can't get the code to cooperate even though myCol does properly reflect the column number.
And this little tester fails as well...?
Code:
Sub Booger()
Dim myCol As Long
myCol = InputBox("Enter a column number")
With Sheets("Sheet2")
.Range(Cells(1, myCol), Cells(25, myCol)).Select
End With
End Sub
Here is the segment I am trying to make work in the main code
Code:
With Sheets("Sheet2").Range(Cells(1, myCol), Cells(25, myCol))
Set Rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
[Code] .......
View 5 Replies
View Related
Apr 23, 2007
I am using the first part of the code to select the last cell in a column. I wish to enter that cell into a InputBox, rather that the default "A3" shown below. How do I modify the second part of the code?
Dim strName As String
Sheets("Prices").Select
Range("A65536").End(xlUp).Select
ActiveCell.Offset(1, 0).Select
Set wSheetStart = ActiveSheet
strName = InputBox(Prompt:="Type in column A cell to paste component into", _
Title:="Price List Paste", Default:="A3")
Range(strName).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
View 7 Replies
View Related
Jul 18, 2009
Here is my delimma. I am using the standard InputBox for my users to input the number of errors found for each category in a record from a daily report. The problem I having is that every time the user types in data using the InputBox it overwrites the previous days numbers. I need to set up the InputBox code so that after the user has input the numbers for that day that the next time the InputBox is used it selects the next column to the right and continues to do this for each day.
View 4 Replies
View Related
Sep 25, 2008
I have another dilema. I am writing a macro that essentially takes a template from a workbook and copies it to another workbook that already has data. the data is then imputed into the pasted template through the macro... my dilema is that I have numerous data sheets so at the begining of the code I need the macro to pause so the user can manually select the cell or range that the copied template is to be pasted too... I was thinking an inputbox would work but I am unsure how to write this part of the code.
View 3 Replies
View Related
Jul 31, 2007
The report is a "template" that will be ran once a month every month and will look back at the previous month's data. What i've invisioned is writing a vb script to load on workbook open asking various questions via "inputbox()" method.
SET NOCOUNT ON
DECLARE @StartDate DateTime
DECLARE @EndDate DateTime
SET @StartDate = '20070731 10:10:51.450'
SET @EndDate = '20070731 10:11:51.450'
SET ROWCOUNT 100
SET NOCOUNT OFF
SELECT EventTagName = EventHistory.TagName, Value
FROM EventHistory
INNER JOIN AnalogSnapshot ON EventHistory.EventLogKey = AnalogSnapshot.EventLogKey
INNER JOIN SnapshotTag ON SnapshotTag.SnapshotTagKey = AnalogSnapshot.SnapshotTagKey
WHERE SnapshotTag.TagName IN ('SysSpaceMain')
AND DateTime >= @StartDate
AND DateTime
View 9 Replies
View Related
Dec 30, 2008
I have a macro that sends data from excel using MS Outlook. I want to add a more specific Subject header in outlook, and do this using an input box.
I thought adding something like this would work, but it doesn't... (below are just extracts from a very long code...)
Dim CurMonth as String
CurMonth = InputBox("Please enter the reporting month","")
.Subject = "Trial Balance - All companies" & CurMonth
When outlook generates the email, all I get in the subject line is "Trial Balance - All companies"
View 9 Replies
View Related
Jun 4, 2009
I am trying to create an inputbox using code from this site:
Sub NumericDataType()
Dim lNum As Long
On Error Resume Next
Application.DisplayAlerts = False
lNum = Application.InputBox _
(Prompt:="Please enter you age.", _
Title:="HOW OLD ARE YOU", Type:=1)
On Error Goto 0
Application.DisplayAlerts = True
If lNum = 0 Then
Exit Sub
Else
MsgBox "You are " & lNum & " years old."
End If
End Sub
I get an error on the first line that says, "Compile error: argument not optional".
View 4 Replies
View Related
Mar 22, 2007
I am trying to simply the data input for someone who is not very experienced.
I have had some success but need to have an extra option in case of mistakes.
Ideally I need the following -
I want an inputbox that will appear when the user starts the macro and for example asks Enter Surname
Then I know what I want but I don't know how to do it.
I want a box to display the Surname that the user typed into the inputbox with a message asking Are Details Correct? with a Yes and No Button.
Clicking the Yes button moves onto the next inputbox clicking the No button cancels the whole macro before it enters data into cells.
View 9 Replies
View Related
Aug 30, 2012
How to use Exit Sub when I push Cancel with InputBox. Heres my code
VB:
Dim fName As String
Dim strMessage As String
strMessage = "Select .csv File"
MsgBox strMessage
[Code] ....
Its working at the moment when I push cancel, but when I select a csv file to import it comes up with an incompatible error.
View 2 Replies
View Related
Feb 21, 2013
In the following code snippet I have worked out a way to verify that the user inputs an Integer and then prompts downstream if an improper value was entered. The user is prompted for a corrected reponse and loops until they get it right. The initial Cancel at the first prompt was causing issues until i saw poster: titarelli use StrPtr(). Except for subsequent cancels, the code works but it is clunky at best. How to tighten this up?
VB:
Dim Quantity As Variant
Dim CorrectedQuantity As Variant
Dim j As Integer
j = 194
Quantity = 0
CorrectedQuantity = 0
[Code] ......
View 2 Replies
View Related
Jun 5, 2014
i have a close workbook with path ("Z:42766Jan 2 Dec 2014Tally.ERP9GrpSum.xls") from another open workbook i want to popup a inputbox to select the sheet and run the macro on selected sheet.
e.g
i put 2 in inputbox than run the macro on sheet2
View 2 Replies
View Related
Feb 9, 2014
It show error, how to correct it .
[Code] ......
View 1 Replies
View Related
Jun 3, 2008
I have a VBA userform with various textbox fields like 'Name' and 'Address' and 'Amount'
I would like an input box to pop up that asks the user to 're-enter for verification'
So that they have to type the same thing twice, to protect against typos
How do I code it so the program compares the inputbox to the textbox and passes only if they are identical?
(or even, using two inputboxes instead if that would be easier)
View 13 Replies
View Related
Oct 2, 2008
I am working on a production spreadsheet, and I'm trying to figure out the easiest way for my coworkers to enter data into the system. Each shift, we produce from 5-20 different varieties of chips, and we keep track of how much we've made of each. I've decided that a simple ADD and DEL button at the end of each row will work (unless anyone can think of something easier or better, let me know pls).
Cell G3:G30 is where data will be stored for each variety. The default value for each variety is stored in column C. I found a very basic macro that adds a value to a selected cell, but I wish for it to find the default quantity for the variety in that row (changes day to day as per our schedule), and add it to the value in column G. The DEL button will do just the opposite.
I have 3 worksheets that I need this macro in as well (days, afternoons, midnights), but I don't think that will be any problem. I've searched around for a solution, to no avail.
View 6 Replies
View Related
Oct 2, 2008
I have a worksheet, attached, that is a supplier response to a purchase order. Column E contains the original qty ordered of each part number, Column H contains the original price. Now, I've created a quick macro, (in the workbook), that copies the original values to the confirmed values, and the formulas in columns G and J calculate the qty backordered, or flags the part as a price change.
After copying the original PO values to the confirmed values, the supplier would need to go in and make whatever changes are necessary. For example, we ordered 3 and they shipped 0 of a certain part, or the price has changed.
What I would like to do is create a macro that pops up an input box where the supplier enters the Keystone part number, (column A), then enters the new quantity or new price, and those items are automatically changed on the response form. I picture it in the form of 3 input boxes, in the first box the buyer enters a part number. A second box pops up asking if it's a qty change or price change. They would enter the value in a 3rd box, and that value would automatically be changed on the response.
View 5 Replies
View Related
Oct 14, 2008
I have a quick question that'll hopefully have a quick answer. Part of my workbook requires an input box to appear. When you type the name of one of the worksheets into the box and hit enter I want a VLOOKUP formula I've written to compare to that worksheet. Heres what I mean, with some descriptions of what i would like:
View 8 Replies
View Related
Jun 3, 2009
I have a macro that takes input from the user and replaces certain text on several worksheets. One of the inputs is a username in the format of firstname.lastname. I need to manipulate this input such that the dot is removed and the first twelve characters only are used, all in upper case. e.g. Michael.Jackson would become MICHAELJACKS
I know how to use cells.replace to replace the text but I don't know how to use a formula to manipulate the inputbox text before I do the replace.
View 4 Replies
View Related
Jun 16, 2009
InputBox User Validation. Need to modify my code as follows?
View 5 Replies
View Related
Jul 2, 2009
as i understand CInt() converts STRING variables to INTEGER variables. I am trying to create an inputbox, with input validation. So, if the user types in an integer, it will continue to a msgbox; if they type a number in string format, as in 'two', it will convert this into an integer and again display it in a msgbox; if they press nothing a msgbox will appear telling them there is no input; and if they press cancel the programme closes.
View 4 Replies
View Related
Aug 13, 2009
Need a way to get/calculate ALL of the days of the months from a date range entered into an inputbox in which a user may enter any day of a month? In other words, the user enters 9/14/2009 in the first inputbox then 10/8/2012 in the second and code would calculate the number of days as 9/1/2009 - 10/31/2012.
Here is the current code I'm using that calculates only the exact days:
View 3 Replies
View Related
Sep 14, 2009
I have a VBA code that works really well but i wondering if there is a way to do the same thing but without the message box and just enter in the dates instead.
View 11 Replies
View Related
Sep 18, 2009
I have not used Inputboxes or Userforms much. I have read through some of the messages here, but I need to learn more about them. I need to create some type of user interface, where the user would be asked to select between two choices. Based on the choice made, a macro would be executed. The two choices run different macros.
I need direction or an example of an Inputbox that shows two choices instead of a blank input space.
View 3 Replies
View Related
Oct 20, 2009
I have two inputboxes. I want to set the default value of the second inputbox as (effectively) one cell down from the first inputbox entry. In other words, if I type G17 into the first inputbox, I want the second inputbox to then have a default value of G18.
View 5 Replies
View Related
Dec 18, 2009
I have workbook and when I open it I'd like to be able to open another workbook and copy the data into a new sheet in original workbook. The file I'd like to open is always "123_PPS.CSV". I'd like to enter the number (123) into a msg box and then have that file open or copy into sheet2 so that I can get info from it into the cells in the packing slip.
View 14 Replies
View Related
Apr 4, 2012
I am working on a script that allows a user to enter a number (days), and an automatic process performs based on that number. The inputbox has a default value. I have everything except for one issue--we would like the default value to be accepted and the inputbox close if the user does not click OK in say 20 seconds (in order to keep the process from tying up the rest of the process). Is there a way in VBA to click "OK" in the inputbox in 20 seconds so the process can run if the user doesn't click it himself?
View 5 Replies
View Related
Apr 11, 2012
I am trying to get an inputbox name a shape within my workbook. This is what I have so far and i am getting a Run-time error ("The specific value is out of range") on the part in red.
Code:
Dim MyInput
Sheets("List Form").Select
ActiveSheet.Shapes.Range(Array("BlankTestButton")).Select
Selection.Copy
Sheets("For Copy").Select
Range("A36").Select
ActiveSheet.Paste
[code].....
View 3 Replies
View Related
May 27, 2013
I made a selection and coloring macro, the filter is based on the inputbox that pops up. What I would like to do here is, that when the box pops up it would have a written date in it, which is the today always. And the filter should select all which is 2 weeks later than current date.
Code:
Sub kethet()
Dim datum As Long
Dim most As String
LRow = Range("E" & Rows.Count).End(xlUp).Row
[Code] ..........
View 5 Replies
View Related