Macro Which Cycles Through User Inputted Values And Prints Sheet
Jun 21, 2014
I'm looking to create a macro which displays a user entry box where the user can input a starting number and then input an ending number. The macro will then cycle through that range inputting each value into a specific cell and perform a print function. It will continue doing this until the last number in the range.
Min. Number inputted = 1
Max. Number inputted = 80
Macro will not cycle through that range:
Input 1 into Sheet1 Range A1
Input 2 into Sheet1 Range A1
.....Continue doing this until it reaches 80
Is there anyway to detect if the user has just printed. I have code which transfer data from the sheet to an access file when the user prints using the button I placed on the sheet, unfortunately some users are using the print button on the toolbar.
I have a Workbook that has 2 worksheets, one called CALL QUERY and one called CALL LOG. On the CALL QUERY sheet, cell D9 is a user inputted cell with the cell validation set to list. The user uses the dripdown list to pick an office identifier (3-Letter Code).
On the CALL LOG sheet, I have info about individual calls. Column E has the 3-letter office identifier for each call.
I am trying to find a way to automatically auto filter the list on the CALL LOG sheet with the user input in cell D9 on the CALL QUERY sheet.
I was given the following (N2 is a cell on the CALL LOG sheet that equals the user inputted cell D9 on the CALL QUERY sheet)
i am looking to create a macro that cycles through sub folders within a main fold and takes the same line of nformation from each workbook that it cintains.
the main folder is a yearly folder "2008" there a 12 subfolders within this named "january" to "December" (one for each of the months of the year) Within the monthly folder are four weekly forlders named "week 1" to "week 4"
each of the line in the workbook ferer to a different person so i will need to transfer all of them into individual summary workbooks. but in this example i need to take the information from A3 - K3 from each workbook.
I am trying to do is to make it so that users can enter data into my form (I have managed to create the form and am working on trying to figure out how to get the info entered into the form to appear in my worksheet) and then the data will cause the information to, basically, compile sentences that I want to appear in one of three cells at the bottom of the worksheet.
Essentially, at this point in time, the end goal is to make 3 cells that contain text. Eventually, this text will be indexed elsewhere, but that is for the next person to deal with. I am creating a prototype that I want to present as a process improvement.
So, when the user selects 3 in cell D7 I want the text "Customer purchased 3 Widgets at $20 each." to print in cell 82B. I also want the user to be able to copy and paste some customer records from another program directly into a cell in the form that will just print (unchanged) into one of these boxes, too.
Lastly, I want the user to be able to select checkboxes that will, when selected, print a comment that will print in two of these boxes. For example, if the user selects yes for cell D26 then I want the text "Customer not eligible for free shipping" to appear in both cells C82 and D82.
I am using the following code written by a former employee to set a print area for 3 different ranges in my workbook. For some reason the pages are coming out in a landscape format. How do I get the macro to print in portrait?
The code bellow allows for me have the current sheet saved "printed" to a pdf file with name taken from a cell value.
After that it also prints 3 hard copies with a cell value being changed for each print.
Can I have this but on the pdf code so that the 3 pages are also saved "printed" to pdf?
Code: 'Selects doPDF to genarate PDF file of invoice and names it accordingly to cell L17 which is the invoice number. Application.ActivePrinter = "doPDF v7 on DOP7:" ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ "E:LusaGenerated InvoicesINV" & Range("L17").Text & ".pdf", _ Quality:=xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas _ :=False, OpenAfterPublish:=False
I have a workbook with several sheets. I have written a macro to check if the value in a column is matching with that in another column in another sheet and return the value in a preceding column in the second sheet into a preceeding column in the first sheet. The code looks likes this and seems to be working fine.
Sub Copy_Price_Code() Dim Rw As Long For Rw = 6 To Sheet6.UsedRange.Rows.Count
However, there would be more sheets in the workbook in future and I need to edit the macro in such a way that the user can select the source and destination sheets which I could use in the above macro. I tried to do it as follows but its not working.
Sub Copy_Price_Code() Dim Rw As Long Dim Rw2 As Long Dim Sourcesheet As String Dim Destinationsheet As String Sourcesheet = InputBox(Prompt:="Enter source sheet name. (example: Sheet1).", _
There is a macro i wrote that assigns buttons to different tasks, and it changes the name of each button to whatever task the user utilizes it for. I would like for the changes to be permanent, and i can do it if i can just keep the information in the userform. So, the most logical solution is to permanently change the names of the buttons in the userform, but this has to be accomplished by the users choice, which means i don't do it through the vbe. How do you change a button's caption permanently through macro?
I have created a form in a worksheet which I have added questions too and then locked all cells except the ones where I want the answers in.
I have then added a button to the bottom of the sheet called "Print and Save". This work sheet is called "form"
On a second sheet called "database", I have all the titles of the questions running from a -> k and nother else.
What I want to happen is the user input the information on "form" into the boxes available. Once they have completed the questions, I want them to be able to click on "Print and Save" so that firstly the page "form" prints, and then for all of the answers to be saved in "database" below the titles for each question.
I have had a play, but just don't know where to start. Also, once there is a row of questions below the titles, I don't want it to overwrite information already there, it needs to go onto the next empty row available.
Attached is my excel file.
You will see in the code that I have the code for printing.. I just found this on the net and it seems to work fine for me.
I have a progress bar on a form......it is there for no reason other than for me to practise such things...the code came off these forums and the bar is powered by a random number...
now my problem is the moment it start running i cannot do anything on the form....i would like my bar to do it's thing but still be able to click on the cancel button to get out of the form any help on this would be fantastic
Private Sub UserForm_Activate() Dim dTime As Date Dim i As Integer
Do Until i = 100 For i = 1 To 100 Step 100 / 8 dTime = Now + TimeValue("0:00:01") Application.Wait TimeValue(dTime) ' ProgressBar1.Value = RandNumGen(1, 98, 1) 'AboutScreen.Repaint Next i 'AboutScreen.Repaint Loop
I'm working with a workbook that has about 75 sheets. I need a macro that will copy the info in a certain couple of ranges from one sheet to the same ranges in another. This would not be a problem if it was always the same two sheets. But I need the user to be able to specify which sheet he wants to copy from and which sheet he wants to copy to.
The ranges on the sheets will always remain the same, just the sheet name needs to change. I created drop down boxes for the user to choose the copy from and copy to sheets, but I don't know how to insert that into the VBA code. The way I've designed it, the macro needs to read the result from the user that is on sheet "Index" in cell H5 to copy from and N5 to copy to. The result in those cells is the actual sheet name.
I am trying to develop a macro that allows the user to copy and paste a set of date and time values, move them to the next sheet and increase the month by 1. I need help trying to find out how can I create a counter for the program to keep running without the need to reprogram the macros again.
(1) My main tab I have a macro button that inserts a new row and also inserts a new sheet with the rows name that was inputted. But on the main tab in cell A1 that is named, I can not get it to hyperlink to the new tab.
(2) When the button is hit to insert a new row and sheet I copy over previous tabs information and then I want to change two fields A1 and B1, A1 works fine but my B1 I can not get the formula to work correctly. My cell in B1 I need it to say 'DESCRIPTION: ' and then take the value of main tab 'Test Case Summaries' cell D?, it would be the new line and copy it here. See below... rname is the new tab name and lrow is the new row that was added when the macro button is hit.
t = Sheets.Count Sheets(t).Copy after:=Sheets(t) ActiveSheet.Name = rname
I have got the task of doing the results for a local athletics mid-distance event once again and im fed up of doing it the present way. Basically i have a sheet which i input the race registrations which has the following collums: Number, Name,School,
and i have another sheet for results which have: Position,Number,Time. I then have to merge the two in a magical way and i get the results. However what i want to do is have the first sheet the same but the results sheet would be different reading: Postion,Number,Name,School, Time
But when i input the number, it will check with the other sheet and automatically fill the rest of the boxes (bar position and time) hopefully. Using my knowlegde i gathered at college(fairly average knowledge of vb) i still cant get it to work the way i planned. Is it actually possible to do, or should i go to my pet hate access?
I was thinking of how the Worksheet_Change(ByVal Target As Range) macro can be used to paste values instead of formula when the user uses Ctrl-C and Ctrl-V. Instead of assigning a macro to a command button for user to activate.
Suppose I have a worksheet where the range ("D7:D56") is where I would want the user to paste his values in it. I have to factor in the possibility that these values have formulas attached to them, and that the user is not tech-savvy enough to know about the "paste special --> values" functionality of excel, and chooses to use the Ctrl-C, Ctrl-V method instead.
What then appears are ####### which might alarm the user.
Neither would we want the user to press a button (which we can assign the xlpastevalues macro as an alternative) as that adds an extra step for the user. There is also a chance the user might not use the button, or overlooked it.
Is it possible to use the Worksheet_Change(ByVal Target As Range) macro, or sth similar, to paste values instead of formula when user uses Ctrl-C and Ctrl-V?
is there a function to change the file after it prints?
here is my issue, im printing out P.O.'s at work (purchase orders) and i have to put the P.O. number in manually. so i put in say 1601 then i arrow down till i hit the second p.o. number box (2 p.o.'s per page) and then enter 1602 then hit control + P to print then click back at the top and repeat but changing the number to 2 more than the number previously in the box.
is there some what to do this automatically so i dont have to do it my self?
I am trying to write a macro which does a screen print of a couple of sheets in a spreadsheet. I created the macro using the recorder function and then trimmed it down a bit. However, when I run the macro it pops up with the box asking for a file location, and this is not something that the recoder function seems to write into the macro. I am not sure how to have the macro autofil the file location for the screen print. Is there anyone out there who can give me a hand with this? Thanks. The code for the macro is below...
Sub ScreenPrint() Sheets( Array("Sheet1", "Sheet2", "Sheet3")).Select Application.ActivePrinter = "Microsoft Office Document Image Writer on Ne00:" Selection.PrintOut Copies:=1, ActivePrinter:= _ "Microsoft Office Document Image Writer on Ne00:", Collate:=True Sheets("Sheet1").Select End Sub
When printing an Excel workbook/Worksheet that has been emailed via Lotus notes 7.02 the print job is all blank pages - PrintPreview is normal and correct - Page Breaks are set correctly - The correct number of pages are printed but, ALL Pages are blank. The printer is an HP 6310 All-in-One connected locally via USB. If Printed to Adobe, ALL pages are correct and can be printed on the HP 6310. If another printer is selected (ie: Any Network Printer) the results are the same. This occurrs only on certain spreadsheats received from only a few users.
I am looking for a macro that will copy a worksheet to a new workbook and 'paste as values only' - this is because I already have a macro that I am trying to use to 'autofilter' the sheet to only show rows and colums that have entries in them. Since the sheet is dynamic, the macro will not work unless I copy and paste as values only...
Workbook attached - FYI, the 2 sheets in the workbook are actually in 2 separate books, I have just put them together to make it easier to post here...