Input Data Macro
Apr 18, 2009I am looking for a macro which will help make my workbook more user friendly.
Is it possible to have a macro which when run brings up dialog boxes for user input into certain sheets etc.?
I am looking for a macro which will help make my workbook more user friendly.
Is it possible to have a macro which when run brings up dialog boxes for user input into certain sheets etc.?
I want to run a macro that unhides 15 lines (line 20 to 35) when data is inputed on cell 'F6' and to run another macro called "search" (i have already finished this macro) which will fill in information on the unhidden lines from above.
View 4 Replies View RelatedI need a simple macro to enter data for hours worked, but don't like the inputbox.
I need to enter the Emp Nbr in B1.
AM in Time in B3
AM out Time in B4
PM in Time in B7
PM out Time in B8
I then write down the hours worked and
Return to B1
When I enter an new number, I want it to put 0 in B3,B4,B7 and B8
(see attached) Oops can't post. There is probably a better way to calculate the sub-totals, but this works except on an enter of 1200
I often have to research long sheets of data, which requires filling data in on my research sheet from several different sources. The research sheet has a file # in A and a vendor # in C. The data sources have the file #s & vendor #s in varying columns, but I use a pivot table to end up with file # in A, vendor # in B and the needed data in C.
The length of the research sheet varies from month to month - often 800-900 rows, so you can imagine how tedious it is to find the correct file #/vendor # combination to plug the data in. (Many of the rows on the research sheet will not have a row on the data source sheet.)
I managed to get an array formula in one of the columns on the research sheet that actually DOES work:
Code:
{=INDEX('Acct Activity'!C$1:C$7,MATCH(A7&C7,'Acct Activity'!A$1:A$7&'Acct Activity'!B$1:B$7,0))}
But the problem is that it returns #N/A in any row that doesn't have any data. This messes up the sum formula in the farthest right column. So, I tried to incorporate an ISERROR in with the formula, but couldn't get it to work; it left all the cells blank.
In the meantime, I got to thinking that, since there are up to 3 columns requiring data on the research sheet & each column's data comes from a different source, wouldn't it be great to have a macro where I could use a couple of Input Boxes: 1 that would let me click on the column where the data NEEDS to go & 1 that would let me tell it (either by typing the worksheet name or by clicking on the worksheet " PREFERRED " where the data come from)!
So, I spent the entire day yesterday trying to make any of that work & can NOT figure it out! I got the macro to pop up the first input box, & can key in the column letter, but clicking OK doesn't do anything. Yesterday, I had it so I could click OK & the box would go away, but nothing else happened & the second box wouldn't work right.
THEN, I started trying to figure out how to do an array formula in a macro & my head nearly exploded! I have a terrible time trying to understand written descriptions if they're in "tech speak", so it was all greek to me.
Here is all the farther I got with the macro:
Code:
Sub ClearingRsch()
' Jenny 10092011
With Application
.ScreenUpdating = False
.EnableEvents = False
.Calculation = xlCalculationManual
.DisplayAlerts = False
[Code] ......
I work for a marketing agency where technical savvy-ness is really limited. We analyze a lot of web page elements. I have a program that exports this data into a csv file and I've created a template for the user to add this sheet. This data is primarily text. I've created a button on another sheet that runs a macro that extracts data from the first sheet onto the second sheet in a particular format for ease of reading and editing it. That part is all good, this macro works and the button works. Now I'm trying to have it such when a person edits one of these cells, it highlights the changes on this newly sheet using VBA (the highlighting changes function just turned out to be too messy and buggy for what I want). I have this basic change macro that I have on the sheet currently:
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:H500"
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
.Interior.ColorIndex = 30
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub
This works as well. However, my problem is that when I run the data button macro, of course excel reads this as a change to the cell and highlights it as a change before any actual changes are made. How can I have it so I run my data macro, and the cell changes are highlighted only *after* the user goes in to edit the text data plugged in from the data macro?
In my "cover" sheet I click the allocate cover button and it then generates a list of data below the first table. This generated data now needs to update the "timetable" sheet by using the "allocated cover teacher" and "period" cells as a reference to then input the class code into the timetable at this time.
cover.jpg
So in this picture we see that Dorothy*Schultz (in cell E27) has been given a class 3 MABA RM 15(cell D27) on TuesdayP1 (C27). I want search for Dorothy*Schultz and TuesdayP1 in the "timetable" tab to input the name of the class which in this instance would be input to cell I20 in the "timetable tab".
VBA COVER Forum Version 1.xls
I would like to delete a column using data validation list. for example :
i have a data validation INPUT list in cell A1 (Part No., Supplier 1, Supplier 2, Supplier 3) the heading start from B2,C2,D2,E2,F2. If user select Supplier 1 from data validation list in cell A1, the column Supplier 1 [c2] should be deleted.
And/or also if in cell B1 have a data validation INPUT row list (Part no.) & if user select part no.,
the selected part no. row should be deleted.
I have the following macro that imports data from several input files and rearranges it in a master file.I want to change it so that I can use it in each of the input files. Therefore, it should look in the input file for Spreadsheet "XYZ" and rearrange it in Spreadsheet "Data".
[Code].....
I have recorded the following marco and it works fine. I would like to modify it so the user would highlight a range of cells rather than have the fixed area :
"'ConsExecProp@20120920'!R4C5:R113C21"
What code lines would need to be added?
Application.Goto Reference:="R4C5"
ActiveWorkbook.PivotCaches.Create(SourceType:=xlConsolidation, SourceData:= _
Array("'ConsExecProp@20120920'!R4C5:R113C21"), Version:=xlPivotTableVersion12 _
[code]....
I have an excel file with several rows of data in it, and have a macro currently written to fill out a blank form from the information in a given row. I was wondering if there is a way to prompt the user to input which row you want the data to be pulled from.
For example:
Which row to input data from?
- 4
Then have the macro run, pulling the data from the cells in row 4, rather than row 2, which is how I have written it to begin with.
I didnt write the code from scratch, I just used the record function and it traced my actions, and does what I want it to do, but only for the data in row 2...and I want to be able to specify which row to pull data from.
Trying to use Excel Data List to create a database style report. IE. Originally blank sheet, which is only populated by data containing data matching "filters" input into cells ( say A1 & A2 )
I.e. A1 = Delivery week to be filtered by, and B1 Manufacturer Name
So if I type week "1" into A1 & Manufacturer "Microsoft" into A2, it will show a table only containing data Microsoft, Week 1, and associated data for those lines across the screen.
Week 1
Microsoft
PO number : Date Ordered: Address 1, 2 3 etc....
0011 01/01/13 Somewhere
0015 02/01/13 Anywhere
0213 05/01/13 Nowhere
I know this is much easier with a database, however my manager insists a database cannot be used, and it must be in a spreadsheet format !
I have an month input in cells B2 (user can enter values from 1-5)
I then have a data table that has month 1,2,3,4,5 running across range G9:K9. the data is held in range G10:K19.
So if user types in 4 in B2, what should happen is that months 1,2,3 and 4 the data for these months should be cleared and data in month 5 moves forward into month 1.
So basically, anything left of the month entered is B2 should be cleared and replaced with anything right of the month in B2.
1
2
3
4
5
£11
£133
£29
£193
£100
[Code] ........
I have a two sheet, in Sheet1 i have a data, and in sheet 2 i have a count of location wise data in it, which is from sheet1.. And beside it u will see a button "View Detail". When you click on that button it will pop up a userform which have listbox and 2 button.. Now in listbox i get a filtered value of column C of sheet1 (For eg. Mumbai, Pune, Chennai).. When i click on the value (Mumbai) in Listbox and then click on View Location Details. It should give me a details of mumbai based candidate, like name, pod no, location in the range of (H5:J100) of sheet2..
I wrote the code for it but its not giving me the correct data..
I am trying to write a VBA macro that will mimic what i have already done in an excel worksheet i have made. The excel worksheet uses inputs for a heat exchanger and finds the temperature as it leaves the heat exchanger. This temperature is then the new input for the second line of the worksheet and it changes quite a few of the values in the sheet. I have the excel worksheet working where you just drage the row down and it does it automaticly, but i would like to have a VBA macro that all the values can be input in with the number of cycles until the heat exchanger equalizes out.
I am able to get the macro to work when it calculates just the first cycle, all the equations work my variables are ok for just one time. What i don't know how to do is make my program realize that it has to use the calculated temperature out of the heat exchanger as my new input for the heat exchanger. I know how to do it once so it is more of a syntax or understanding of a loop or an array for the values that are changing.
With guidance from this board in the past, I was directed to a macro that sorted information on a sheet (using values in column 1), opening a new sheet named by the sort title then copy/pasting all the relevant entries
The only restriction for this macro is the fact it is set to only sort information on sheet named Sheet1
I wanted to change this to an InputBox so the user can tell the macro which sheet to sort
i need a macro to insert the formula i have in Column M row 3, and insert it all the way down to the last letter that is contained in column k. So in this example The Last Letter in Column K is AQ, ( i dont physically mean last i mean last in alphabetical order in excel , such as ( W X Y Z, AB, AC , AD ) AD would be last.
So since AQ is last it would insert the formula 43 times, which is AQ. THe AFter tab should clear any confusion up because this is how it looks finished. I use various sheets like this so the last letter changes, so having this macro be dynamic and not attached to a sheet name would be ideal.
I would like to do a Macro which requires user to go to a specific line which is variable in each work sheet. I would like to be able to enter the number and then delete all lines below that point and then continue with the balance of the macro.
Is there an easy way to pause the Macro and then restart it? Or is there a code that I can insert in the Macro to locate a specific Cell and then delete all lines below the next line?
I have a document with multiple sheets that contain data for a specific date and are set up in chronological order. The last sheet(Final Sheet) has each row as a different date in a chronological range of 3 yrs and each row has 5 cells of data.
I need to write a macro that will take a 5 cell row from each sheet and place it in the correlating date/row in the Final Sheet. Each sheet is labeled as the date for which the data is from so the macro needs to match the sheet title to the date in column A of Final Sheet. Then place the 5 cells from the sheet into the correlating date/row. The macro would need to loop through and do this until it reaches the Final Sheet.
However, with this macro I am wanting to remove the Input Box that pops up and requires the user to hit 'enter' everytime the macro runs. Instead, I would like the macro to automatically insert the rows based upon the value of cell A1 without having to confirm with the Input Box.
Code:
Sub InsertRowsAndFillFormulas_caller()
Call InsertRowsAndFillFormulas
End Sub
[Code]....
Because I am such a novice with coding, if the response could be in a form where the entire macro code is spelled out on what needs to be changed. That way I can just copy and paste the macro response instead of having to try and figure out how to apply your suggestions to my existing code.
Macro to save as "xxx" Input box "___".xls
in the same folder as the original file?
xxx is defalut part of file name and input box for user to add criteria about file.xls
ie.. xxx_critera.xls
I would like to write a macro that would start by asking me something along the lines of, "Enter student # you want to print a report about." The # I enter would need to be stored as a variable in the VB code, and then my code would need to use the variable to do some search and replace operations. (Replace all instances of 10 (the default student number) with the variable I have specified).
I don't really know how to even start going about this. How do I get Excel to ask me for a variable, and then use that variable in code?
I have this macro in which the user clicks a button and it formats a file for them. I want a box next to the button where the user can enter a number first then click the button and then the file will use that number to calculate a column. Any help is appreciated.
For example part of my macro is this.
Lcol = Range("IV5").End(xlToLeft).Column + 1
Cells(5, Lcol) = "Total Cost"
Worksheets("sheet1").Range("u6").Formula = "=IFERROR((RC[-1]/RC[-3])*the number the person entered first,0)"
Lrow = Range("A" & Rows.Count).End(xlUp).row
Range("u6").AutoFill Destination:=Range("u6:u" & Lrow), Type:=xlFillDefault
With Range("u6:u" & Lrow)
.Copy
.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End With
Application.CutCopyMode = False
Creating a working userform that takes data input from the user and puts it onto a spread sheet.
That data is then used to calculate a result (via the spreadsheet), and I want that result to show on the userform when the data is submitted (if that makes sense?)
I have a very simple macro for recalculating formulas and printing the page.
I need a way to show an input box where the user can say how many times to repeat the process i.e. 2x = recalculate, print, recalculate, print.
Due to the economy we are only scheduling days to work one week ahead which leads to alot of phone calls. The gaurds who get the calls then search thru a printed spreadsheet looking for a clock number or last name. I realized right away they should just look at the file on the computer and due edit - find. The problem is they due not use computers unless printing and they looked at me like I was talking in a different language. So I want to edit this macro below so it will allow user to type in search criteria instead of using same search criteria every time. Here it is 70039. I also need to place a shortcut or button to this macro on the toolbar or sheet and do not know how. How do I stop "remove macro or enable when file is loaded"?
View 3 Replies View RelatedI have several hundred workbooks with multiple worksheets(15-35) that I am trying to tidy up, so the data can be entered into a database. Its my first attempt at VBA and between the forum and macro recorder I made an attempt which is below. I just can't seem to get over the last part. I have searched the forum but can't seem to find any relevant information. I have a couple of questions.
1. I need to be able to run this macro over all the worksheets in the workbook, so how can I loop it? All the worksheets are named differently i.e. peoples names.
2. In my code I have inserted 4 columns. These columns will be the only thing common between all the worksheets. A1 to A30 = Week number, B1 to B30 = Shift Number, C1 to C30 = Supervisor number. Column D is blank. I'd like to be able to be prompted to enter these 3 numbers at the start if possible? Can this be done in such a way as you are only prompted the once and not on each worksheet? I picked 30 rows because the amount of rows in each worksheet varies but never exceeds this. The end of my code "Delete rows where cell B is blank" will delete any excess data where 30 rows of week numbers etc are not needed.
Sub CleanCost1_1()
'
' CleanCost1_1 Macro
' Macro recorded 04/09/2009
'
' Delete Job Card Sheet
Sheets("Job Card").Select
Application.DisplayAlerts = False
ActiveSheet.Delete
Application.DisplayAlerts = True
' Delete Master Sheet
I am using data validation to restrict the number of Characters a user can input in a range of cells. The number of characters in this however can vary based on which selection they selected in a different cell.
To put this as an example, if the user selects "hello" in cell a1, the data validation would allow 10 letters in the cell range c1:c20. If the person selects "goodbye" in cell a1, then the validation would only allow 7 characters in cell range c1:c20. I have been using the worksheet Change function, however it updates the validation regardless of what cell is changed.
So I found a macro that does something similar to what I need.
I tried changing the data range and input column but it doesn't work.
What the macro does is I type whatever name into the msg box and it will copy and paste all the rows that contains the name to a different sheet.
Here is the macro:
VB:
Sub test()Dim vl As String, res, sh, myrange As Range
Application.ScreenUpdating = False: vl = Application.InputBox("Enter value for Column B", Type:=2): If vl = "" Then Exit Sub
[Code]....
Sample Data from "Demand Planning Prem" worksheet
Date
SKU
Name
Begin FG's
[Code]....
This worksheet has around 40,000 records, and I need to create a Macro that will ask the user for a date, and when the user enters a date the macro goes through column A and finds all of the matching dates and then replaces the numbers (along with the formulas) in the corresponding Add Returns cells (column E) with 0's.
I have only been able to create an inputbox, but I am completely lost regarding the criteria due to being very new to VBA.
Sub ClearData()
Dim EnterDate As Date
Dim msg As String
[Code].....
I want to create a macro which asks some information like functions do. For example, I would like the macro to ask for some data to be filled by the user. For that purpose I thought about using the inputBox vba function. I wanna fill the field in the inputBox with a reference to a range from an excel sheet. So, I click on a cell and then I try to hold ctrl + down cursor to get all the range starting from that cell on until the last consecutive filled cell on the sheet. Nonetheless, the problem I have is that when I do ctrl+down cursor, I just do not get the reference I want, because it seems that the ctrl+down cursor combination does not work in the inputbox for filling a reference to a range of cells. Does anyone know some workaround to achieve this?
View 9 Replies View Related