Last Cell In Column To Inputbox

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


ADVERTISEMENT

Inputbox Button Control + Msgbox For Empty Inputbox

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

Set Column With InputBox Entry

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

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 View Related

Select Next Column After Data Input Into InputBox

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

Get Default Value From Cell For Inputbox

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

Enter InputBox Value, After Calculation, Into Cell

Nov 21, 2007

I have made a macro to nominate a % rate in an input box , then have a value multiplied by this rate. Now i need the macro to place the rate followed by a '%' symbol in the cell below.

View 9 Replies View Related

Insert Text String From Inputbox In Cell?

Jan 13, 2012

I'm trying to write a bit of to take a text string collected from an inputbox, and paste it into a specific cell.

Should be easy but where my text string from the inputbox is "XYZ", when it enters it into the required cell it enters it as " ="XYZ" ".

Attempt at code is below -

Code:
Sub EmailEdit()
Dim Response As String
Response = Application.InputBox("Input administrator email address", , , , , , , 2)

'Check to see if Cancel was pressed.
If Response = "" Then

[Code] .....

View 2 Replies View Related

Insert Text From Cell Into Inputbox Message

Apr 21, 2006

I want to be able to specify inside the message the word that is in cell F6. So it would say "You Must Give A Reason For The Amount Of Mgr Voids For Shawn"... shawn being the name in cell F6.

If Range("F9").Value > 50 Then
MyInput = Application.InputBox("You Must Give A Reason For The Amount Of Mgr Voids For This Employee")
If MyInput = "" Then End
If MyInput = False Then End
ActiveSheet. Unprotect ("13792468")
ActiveSheet.Range("F9").AddComment
Range("F9").Comment.Visible = False
Range("F9").Comment.Text Text:="" & Chr(10) & (MyInput) & Chr(10) & ""
ActiveSheet.Protect ("13792468")
End If

View 3 Replies View Related

Assigning Inputbox Value To Cell Works In 2004 Not 2007

Nov 20, 2009

I'm working on a tracking spreadsheet that needs to be able to function on both Excel 2004 for Mac as well as Excel 2007 for PC. The code below is written to ask for a date when the status of a particular row of cells is changed to a value other than "". These cells have validation lists where the list itself is just below the cell in hidden rows. It then places the date entered in the corresponding cell to the right of the list choice in the hidden rows and the top row is simply a vlookup to show the date with the status choice.

This way, when the status cell is changed again, it retains the date in the hidden rows while setting a different one. The code below is obviously not the full code, the whole code includes other functions and is a bit long, but I've narrowed it down to this:

View 5 Replies View Related

Inputbox Method NOT Returning Multi-cell Range Object

Jun 15, 2012

I have the following code in Destination.xlsm that is intended to:

request the user to select a multi-cell range in a column of single-sheet Source.xlsm, in which some but not all cells contain "Y" (to indicate that this row of data relates to a National Account, versus a Territory Account)loop through the selected range, and whenever a cell contains "Y", copy the entire row and insert it in Destination.xlsm above a cell named "rngDest".

Code:

Sub Copy_NationalAccounts_Rows()

Const Message As String = "Select the entire range containing National Account Y flags, then press Enter or click OK."
Const Title As String = "Copy National Accounts"

Dim rngSource As Range
Dim rngDest As Range
Dim r As Range
Dim c As Integer
Dim wbk As Workbook

[Code] ........

View 5 Replies View Related

VBA Inputbox

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

VBA Inputbox To Sql Queries

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

InputBox In Macro

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

Create VBA InputBox

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

Two Option InputBox

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

InputBox - Exit Sub When Cancelled

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

Inputbox Integer Verification

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

Select Sheet Using Inputbox?

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

Date Inputbox Value Correction

Feb 9, 2014

It show error, how to correct it .

[Code] ......

View 1 Replies View Related

Inputbox For Simple Verification

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

InputBox To Edit Data

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

Referencing A Sheet From An Inputbox

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

Manipulate Inputbox Text

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

InputBox User Validation

Jun 16, 2009

InputBox User Validation. Need to modify my code as follows?

View 5 Replies View Related

CInt() Conversion & Inputbox

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

Getting All Days Of Month From Inputbox?

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

Input Date Without Using An InputBox

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

Can Inputbox Have Selections For User?

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

Manipulating InputBox Variable

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







Copyrights 2005-15 www.BigResource.com, All rights reserved