Referencing A Sheet From An Inputbox
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 Complete Thread with Replies
Sponsored Links:
Related Forum Messages:
Search For Value On Current Sheet From Inputbox
I am having some trouble conceptualizing how to write code for the following situation: When the macro starts, the user types in a job title into the box and the macro then searches for this value throughout the whole worksheet. I want to return a msgbox that says if the job title was found and if so, what the cell address is and for that to be stored in a variable. If the job title is not found, then I want to return a msgbox that says the job title was not found.
View Replies!
View Related
Inputbox To Pull Over Information From Another Sheet To Be Reviewed
I am using an inputbox to pull over information from another sheet to be reviewed. The problem is that I can't get the cancel button to work. I am not having a problem with the ok button though. Sub test() Dim pull As String pull = InputBox("How many would you like to retrieve.", "Retrieve", vbOKCancel) If pull = vbOK Then MsgBox "ok " & pull Else MsgBox "Cancel" End If End Sub
View Replies!
View Related
Clicking Cancel On InputBox To Delete Newly Created Sheet
I created with code to copy a template, hide that template, and pop up a box to rename the copy, I noticed she clicked "Cancel" on the InputBox. When she did, she received an error (400). What I would like to do is when the "Cancel" button is clicked, the newly created copy would be deleted. Is this possible? Here is the code for my full "Create New Project" sheet procedure: Sub CreateNewProject() 'This code will copy the Project Data sheet, hide it and then 'rename the new copy to the MSA number. Code also prompts user for 'MSA Number and fills that in on the form. Dim RenameSheet As String Dim oSheet As Worksheet With Sheets("Project Data") .Visible = -1 .Copy After:=Sheets("FHWA Quarterly Report") End With...............
View Replies!
View Related
Referencing Sheet Tabs
Is there a way to use the "value" of a name in a drop-down list to reference a sheet tab name in a formula? A1 has a drop down list. When a name (Bob's Sales) is selected from the drop down list, B1 shows the value of cell D5 from sheet "Bob's Sales".
View Replies!
View Related
Referencing Another Sheet In Same Workbook
I have two sheets in the same work book and I want to pull values through from one to the other. So its a simple =Sheet2!B45 or whatever yeah? But no! What Excel 2007 does when I hit enter is to swap the Sheet!2 bit for "C:documents and Settingsmy documentsspreadsheetsmyworkbook!Sheet2!B45" or some such. Why the hell does it do that and how can I stop it.
View Replies!
View Related
Referencing Cells In Another Sheet
I need assistance referencing cells in other sheets. I have a summary tab which I would have each refenced sheet listed (named for the activity being billed). In a separate cell in the summary tab, I want to bring back the value of the total amount billed for that activity. The total value is in the same cell of each sheet, as all invoice tabs needing to be referenced are identical in layout. There is one hitch to this, the sheets referenced have not yet been created (that would be too too easy), and the activity list in the summary sheet has place holder names that will change when the activity being billed is defined (hence prompting the biller to create the sheet to be referenced).
View Replies!
View Related
Vba Sheet Referencing
I have 8 sheets, named cpt1 to cpt8 in vba. Now i need to loop through these 8 sheets, storing the same range of each sheet into a matrix. I have the following dim test () as variant For i = 1 to 8 (1) test = sheets(i).Range("b2:u21") (2) test = cpt1.Range("b2:u21") next i Now (1) doesn't work, but (2) does. However i do not know how to reference the cpt1 sheet name using the for loop (ie "cpt" & i) Can anyone help me with getting this to work?
View Replies!
View Related
Formula Referencing Previous Sheet
After a formula to copy the contents of a cell in the previous sheet in a workbook, so that if I was to copy the last sheet in a workbook the formula would automatically reference the cell from the copied worksheet and so on if I copied tht one. Hope this makes sense I have a lot of formulas referencing the previous sheet and everytime I copy this sheet to create a new sheet I have to change the sheet number in the formulas. eg, in sheet 8 this formula get info from sheet 7 cel J30 ='7'!J30 when i copy the sheet to create a new one (Sheet 9) I would like the new formula to automatically be ='8'!J30.
View Replies!
View Related
Vlookup - Referencing Sheet Index
I am trying to find out whether it is possible to reference to a sheet index number, instead of sheet name, in a VLOOKUP formula. For instance, normally I would write: VLOOKUP(A1,'ExampleSheet'!A1:B10,2,False) (I hope got the translation to English language Excel correct) Let's say that the sheet index of Examplesheet is 2 (at least it is 2 the way VBA sees it). Is there a way I could reference sheet number 2 in the VLOOKUP formula, instead of its name? My sheet names vary, but the formula should look in the same area, regardless of name.
View Replies!
View Related
Referencing Cells Dependent On Sheet Name
I have a workbook that has a number of sheets with various project stages and dates on them. These details are arranged in small tables displayed vertically down the page. Each worksheet's name is the project code - e.g. 30033_99 I have now been asked to create an overview page that displays all these stages and dates on one page. What I'm trying to do is get Excel to look at the column with the project code and then pull information from the worksheet with that name.
View Replies!
View Related
Referencing Cells From Another Sheet, Dealing With Blanks
I have a sheet which I want to populate from another sheet within the same workbook. I am using the following, where Data = original worksheet, T2=cell to be displayed: =Data!T2 When i do this for the whole spreadsheet, where there are blanks it is entering "0" or in the date fields, 01/01/1900. Is there any easy way of defaulting them to be blank if there is no content in that cell?
View Replies!
View Related
Referencing Active Cell's Value From Another Sheet
I'd like for users to click in a cell in col A in a sheet named "Period7", have the cell value placed in cell C11 in a sheet named "Per7Report," and change the focus or active sheet to sheet Per7Report. Can this be done simply by clicking in a cell, or must a command button be inserted into each cell (note - odd rows only) in col A in Period7. on the code to do this? Note that there is a formula in col A in sheet Period7
View Replies!
View Related
Referencing Sheet Code Names By Variable
I have a set of worksheets (Sheet31 through Sheet49 by codename) produced by a machine in the lab. I want to create a summary sheet that references cells in those worksheets. Rather than go through the annoyance of doing this manually 40+ times I'm working on creating a macro to populate the summary sheet for me. This is what I have so far For J = 31 To 49 ResultSht = SheetJ.Name Sheet1.Activate ActiveSheet.Range("A4").End(xlDown).Offset(1, 0).Select It hangs up on the "SheetJ.Name" however. My objective is to be using the object SheetJ, where the object SheetJ is the codename of the results sheet I'm trying to reference (for example, in the first pass through the loop it would be Sheet31). Could someone point out my mistake in this object reference?
View Replies!
View Related
#REF! Error Referencing Worksheet After Importing Sheet
I have a template i'm making that is full of formula references to sheets not yet in existance in the workbook. what i want to happen is this: My code imports data files, renames the tabs to 1, 2, 3, 4... The formulas i already have are set in the CONCATENATED tab.... an example of such a formula is: ='1'!$P2. so this should work, and yet it doesn't. the sheet is imported as it should be, the tab is renamed to 1, and yet the CONCATENATED sheet still shows #REF for the cell value. if i click in the cell, click in the text bar and enter out, the formula updates. there apparently is no option that i KNOW OF (although i'm sure there is something out there that does...) that will update this without me entering into the text bar and entering out. Question: how do i manually update all references once the sheets to those references have been imported?
View Replies!
View Related
Referencing Selected Tabs To Print Selection & Update Table Of Contents Sheet
I searched but didn't find exactly what I needed. I have a workbook with 31 sheets. It is a price guide with each category on a separate worksheet. I figured out how to list the sheets on a separate tab. What my client wants is the ability to: 1. select certain categories for printing, the ToC, Cover and backcover pages have to print in every case 2. the ToC has to change depending on the sheets selected. I'd rather write some code and give him an an easy command button rather then teaching him how to select non-concurrent sheets and printing only active sheets. What I'm really stuck on is the updating of the ToC with active sheets only (category and starting page which changes depending on pages selected).
View Replies!
View Related
InputBox In Macro
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 Replies!
View Related
Two Option InputBox
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 Replies!
View Related
VBA Inputbox
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 Replies!
View Related
Saving As A Workbook Through Inputbox
When the button is pressed, It opens a Mesage Box giving an alert to the User about what is He going to do...if he clik no the macro stops, if the user click yes then it opens an InputBox ....and the name the user writes there will be the name of the new book... If working good if the user press OK ...my problem comes If the User press CANCEL in the InputBox...The excel try to Save the file as FALSE...and I don´t know how to avoid it. Here is the code. Sub Botón1_AlHacerClic() X = MsgBox("Warning Bla bla ".Are you sure ?", vbYesNo, Title:="IMPORTANTE") Naa = Application.InputBox("Write the file name Here", "New File Name") If X = vbYes Then ChDir "C:UsersROBERTODocumentsBASES DE DATOS" ActiveWorkbook.SaveAs Filename:=Naa, FileFormat:=xlNormal _ , Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _ CreateBackup:=False End If End Sub
View Replies!
View Related
Inputbox To Exclude Data
I need to have an inputbox for users to enter multiple store numbers. What I need to do is actually filter out the store numbers that was entered into the inputbox my code so far is: 'Inputbox to filter out new stores Newstore = InputBox("Enter New Store Numbers seperated by a space", "Enter New Stores", "119 120") x = Split(Newstore, " ") For i = 0 To UBound(x) Range("A1").CurrentRegion.AutoFilter Field:=2, Criteria1:=Array(x) _ , Operator:=xlFilterValues Next i
View Replies!
View Related
InputBox Matche A Name In Column
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 Replies!
View Related
Validate InputBox Entry
validation up to the point that the user can click cancel and exit, also when nothing is entered a msgbox appears and for the 3rd inputbox a value greater than 0 must be entered. Sub Trajectory() 'Trajectory macro t0 = InputBox("Enter a value for the initial time(t0)") 'If t0 = "" Then MsgBox ("You must enter a value for t0!") 'Exit Sub tf = InputBox("Enter a value for the final time(tf)") 'If tf = "" Then MsgBox ("You must enter a value for tf!") 'Exit Sub Dt = InputBox("Enter a value for the time increment(Dt)") 'If Dt = "" Then MsgBox ("You must enter a value for Dt!") 'Exit Sub 'If Dt = 0 Then MsgBox ("You must have a valid increment") x0 = Val( Range("F4")) v0 = Val(Range("F5")) g = Val(Range("F6")) y0 = Val(Range("F7")) q0 = Val(Range(" F8")) Selection.Formula = FILL_TABLE End Sub
View Replies!
View Related
Insert X Rows Via InputBox
I wanted a macro to insert (the number of rows from Input box) below the active cell. Searching the forums, I found the following code. Sub InsertRows() Dim Rng Rng = InputBox("Enter number of rows required.") Range(ActiveCell.Offset(1 0), ActiveCell.Offset(Rng, 0)).Select Selection.EntireRow.Insert End Sub If I enter a number it works fine, but if you click on the cancel button or the X to close the Input box, I get a Run-time error (13: Type mismatch). If you enter zero, it inserts 2 rows above the active cell. I tried to modify another macro, I found on the site, that inserts rows and copies the row above, but always get the Message Box "You didn't specify a range!" Sub InsertNumRows() ' Dim Rng As Range Application.DisplayAlerts = False On Error Resume Next Rng = InputBox("Enter number of rows required.") On Error Goto 0 Application.DisplayAlerts = True.............................
View Replies!
View Related
Get Default Value From Cell For Inputbox
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 Replies!
View Related
Inputbox For Simple Verification
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 Replies!
View Related
Automating File Name Via Inputbox
I am trying to do is have the code display an input box asking the user to type in the file name, or generate this automatically? to an existing folder in a drive My master file, imports data from another source (excel file) pastes it in the necessary columns at the moment, however the file is run every Monday so the file name is generic, last week was 10723, this week will become 10724 when the data is run next week, Can I do what I want to? Via either an inputbox for the file name, or by using something so the file name becomes “107 “ & Weeknum(today()-3)
View Replies!
View Related
Inserting Rows From An Inputbox
I have a store report, which every now and again needs to have a new line added for a new store that has been opened. I need a inputbox to display so that you enter a "store number". Once you enter the store number, the macro adds a new line to add the store number in numberical order.
View Replies!
View Related
Inputbox To Open A File
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 Replies!
View Related
Determine Cancel On InputBox
I am facing a problem while validating an Inputbox actually the issue is that when user press Cancel button on Input box it returns a empty string and also when user does not enters anything in Input box and pressess ok than too a Empty string is returned . Than how we will apply the following conditions : 1) If user does not enter anyting in InputBox and pressess OK than a msgBox should appear saying that "Uhav entered empty string and than looping back to inputbox" 2) If user pressess Cancel procedure should End Sub try() Dim Path Path = InputBox("Specify Path" , "Report Path") If Path = "" Then ' Issue comes here becuse anyways code reahes here if user either lefts the Inputbox empty and presses ok OR user pressess cancel as i need to show different actions for 'different conditions End If End Sub
View Replies!
View Related
Getting All Days Of Month From Inputbox?
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 Replies!
View Related
Insert Text Into An Inputbox **
I have the following code that allows a user to type in an email address into an inputbox, and email a spreadsheet to the recipient in the input box. However, as 99% of the time this is going to be the same email address every time, can I populate the inputbox automatically with a given email address? for eg email@email.com vaRecipients = Application.InputBox("Please enter recipient's email address. Please ensure Lotus Notes is open before sending.", "Email Literature Request")
View Replies!
View Related
Manipulating InputBox Variable
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 Replies!
View Related
Inputbox Method And Ranges
I am having trouble assigning the range given by an inputbox method to the variable targetcells, and subsequently selecting targetcells. any help would be most appreciated. Dim i As Integer Dim CopyCells As Range 'the cells into which links will be copied Dim TargetCells As Range 'the cells that copycells will be linked to Dim CopyAddress As Variant 'the address of the copycells Dim TargetAddress As Variant 'the address of the targetaddress i = 0 For i = 1 To 100 Set CopyCells = Application.InputBox("Click on the cells to copy", "Automating copying links", Type:=8) Set TargetCells = Application.InputBox("Select the target cells", "Automating copying links", Type:=8) TargetCells.Select 'this line doesn't work for some reason (why?) TargetAddress = ActiveWorkbook.Name 'this and the above lines are the ones I am having most trouble with - assigning the name of the targetcells workbook
View Replies!
View Related
Manipulate Inputbox Text
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 Replies!
View Related
InputBox To Edit Data
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 Replies!
View Related
Can Inputbox Have Selections For User?
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 Replies!
View Related
Range Defined By Inputbox
I have a spreadsheet that has 7 columns starting at B and 12 rows. Column B has numbers from 1 to 12 down the rows. I have an inputbox that asks the user for a number from 1 - 12 that relates to a tax period. What I'd like to do is depending on what number they give have that define the range. If they gave me the number 2 my range would be C11:F11, if the number was 10 the range would be C7:F7. The inputbox returns strTaxPeriod.
View Replies!
View Related
Create VBA InputBox
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 Replies!
View Related
Variable Based On Inputbox
I have a macro that is designed to use an inputbox to ask for a number string that represents an entry on the current page, then go to that entry on the current page, and then select various info from that row and then use a portion of that string to move to another sheet which has the name equal to that portion of the string to perform more actions. My current problem is that when I try to set a variable based on a portion of the text input into the inputbox entry it gives me: runtime error 1004: method range of object _gloabal failed. And the line it errors on is the variable definition which is based on a portion of the inputbox entry. Dim MyInput As String Dim ChooseDate As String Dim Hours As String Dim SR As Integer Dim ER As Integer Dim SC As Integer Dim EC As Integer Dim RowVar As Integer Dim ColVar As Integer Dim found As Boolean MyInput = InputBox(" Date-Time Number?") If MyInput = vbNullString Then Exit Sub ChooseDate = (Mid(Range(MyInput), 1, 4)) The "choosedate=" line is where it errors. It's suppose to take, as a string, the first four characters of the text input into the inputbox. Then it searches the current sheet for the entire entry, selects it, uses that row to collect more info and then moves to the sheet in the workbook that has the name equal to the first four digits of the inputbox text to do more actions. I'm sure it's a syntax error but my knowledge is at it's limits.
View Replies!
View Related
Position InputBox Display
I'm looking for a way to specify an offset value for the input message box that's displayed when setting the ShowInput property of Validation object to TRUE. In my project, I use a lot of Validation to prompt the user for the kind of data they need to enter. This method causes a problem because the input message box shows with its upper-left corner directly underneath the currently selected cell. My users (some of whom prefer the mouse) get annoyed with how this box shows up in the way of where their mouse cursor needs to click. Is there a way to set an offset (or similar effect) programatically to keep this box out of the way?
View Replies!
View Related
Last Cell In Column To Inputbox
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 Replies!
View Related
SaveAs - Inputbox Data
I want to use the SaveAs function using the Inputbox results. The user will input a date like 5-30-06. Then I want save the workbook as "WE5-30-06.xls". I can't figure out how to do this b/c it wants to use 5/30/06 which isn't allwoed in naming conventions. BTW the inputbox name is dWeekend.
View Replies!
View Related
|