I have an Excel invoice set up and working well. It does a bunch of things with macros - e.g. on save it increments the invoice number well as creates a jpeg screenshot for the invoice archives. I have added an additional worksheet (titled 'VAT') to the workbook. The new 'VAT' worksheet has five simple columns; Invoice no, Subtotal, VAT, M.O.T. and Total.
What I need:-
On saving the workbook I would like to add a macro function that copys the final contents of the Invoice no (H2), Subtotal (C37), VAT (C38), M.O.T. (F38) and Total (I38) cells from the 'Sales Invoice' worksheet to the newly created 'VAT' worksheet in the respective columns. I would like this to be cumulative, i.e. continue to add the contents of the afore mentioned cells to the appropriate columns in the 'VAT' worksheet every time the invoice is saved. I would also like to have the Subtotal, VAT, MOT and Total columns summed and outputted in a cell of their own - but hopefully I can handle that.
I have a workbook with lets say 10 sheets. 9 of the 10 sheets are identical as far as layout, they just hold different information for different employees. I need to get a range of cells that are NOT empty and copy that data to the 1 different sheet (summary page). A6 through A25 is where the data is going to be, but all those cells may not be filled up, so I want to drop the empty cells from the range. So If only A6-A15 are filled, then those are the only ones that get copied. ALSO (dont you love that) I need to take that number range and have columns A, F and I as well. So if I have A6-A15, I will need the data out of F6-F15 as well.
I have a multiple sheet workbook designed to collect information which is all collated on the last sheet. On one sheet I have a textbox (not the drawing textbox) which is designed to take a string of characters of a specific lenght (150chars) and works well. I'm just trying to get the code to work with a textbox on the same sheet for now, then when its working change it to copy over to another sheet.
Sub TextBox_To_TextBox() Dim x As Integer Dim PreEmp As TextBox, PreEmp2 As TextBox Dim theText As String Set PreEmp = ActiveSheet.TextBoxes("PreEmp") Set PreEmp2 = ActiveSheet.TextBoxes("PreEmp2") For x = 1 To PreEmp.Characters.Count Step 150 theText = PreEmp.Characters(Start:=x, Length:=150).Text PreEmp2.Characters(Start:=x, Length:=150).Text = theText Next End Sub
I'm calling the sub routine but nothing seems to happen.
I am using the following code to copy the contents of a DDE feed.
Code: Private Sub Worksheet_Calculate() Worksheets("Sheet2").Range("A1").EntireRow.Insert Shift:=xlDown Worksheets("Sheet1").Range("A3:F3").Copy Worksheets("Sheet2").Range("A1:F1").PasteSpecial Paste:=xlPasteValues Application.CutCopyMode = False End Sub
What I want to do is only copy the row when the columns contain data, as it stands at the moment it's copying blank rows to sheet 2. Is there a way that I can do this?
I have a Workbook with around 10 worksheets on, each worksheet is a form.
And when one form is completed we have to save a backup. So i want to assign a macro to a button on a worksheet so when clicked it will save a copy of that worksheet ONLY to a destination and not all the other worksheets along with it.
How to copy the entire worksheet into a new workbook and save the file to a specific directory with the following filename format ("exceptions191011 - ie. the word exceptions followed by today's date in ddmmyy format).
How to add the following condition that if a file already exists with that name then to bring up an error message stating the file already exists? As well as save the new workbook, it appears to close the original workbook - can I stop this?
I have a workbook with a worksheet named "Report"... this sheet and it's macros generate a report from data on another sheet. I'm adding a button to copy the (filled) Report sheet to a new workbook, rename the new sheet in the new workbook "Rep[Name]", then save and close the new workbook. I've recorded a maco of me doing these tasks manually, but what's recorded seems very generic, and does not seem to specify what's really occurring...
For example (in part); > Rightclick on the Report tab > Move or Copy > To Book: (new book) > [x]Create a Copy > [OK]
Sub Macro1() Sheets("Report").Select Sheets("Report").Copy End Sub
This recorded macro does not specify (new book), or Before:"Sheet1" as was the result of my actions... and when replayed back, only makes a copy in the active workbook, before the active sheet...
I have this macro I recorded and pieced together from info I found on the net. It works the first time you run it but then it dies because the next new workbook is not "book1" what I would prefer is to have it save the new workbook as the value of sheet2 F2 and "Product Bulletin" so it would look like "##### Product Bulletin" but I don't know how to write it.
I have a multi-worksheet spreadsheet in excel 2003. I want to produce a macro that will just save a copy of the front worksheet values only. That is I don't want to save any formulas or any of the hidden worksheets, just the front page report, plus it's formatting/layout.
I have been working on this application for the past couple weeks and I have this module of code that copy's a worksheet into a new workbook and changes everything into values. However I have added buttons onto this sheet and after running the code again it froze the program, in which I had to manually end. It gave an error afterwards however I don't remember what it said. Now everything I try to run or step through it, nothing happens. And I have turned Events and ScreenUpdating on.
I would also like to note that it won't allow me to perform actions like unhide sheets or unprotect them. The code has not been changed either so what has happened to disable all functionality.
I have been working on this application for the past couple weeks and I have this module of code that copy's a worksheet into a new workbook and changes everything into values. However I have added buttons onto this sheet and after running the code again it froze the program, in which I had to manually end. It gave an error afterwards however I don't remember what it said. Now everything I try to run or step through it, nothing happens. I have turned Events and ScreenUpdating on.
I am trying to copy a column of cells from one sheet to another, but also want to keep all the formatting. The origin sheet has times, but when I copy these to the destination sheet they are displayed as decimal numbers (using the code snippet below). I can change these back to times by formatting the cells using the format painter after the macro completes but I would like the VBA to do this for me. (using 2002 SP3).
I need a way to copy part of contents from a cell, the cell contains product information like size, name and weight of a product, and I need a copy the weight to be put in it’s own cell, here’s a copy of one cell “E65 MAPP SKDV 5 DIGIT 90G ST.K” the information I need from this is “90” the number is always followed by a capital G, but it’s between two and three digits where the lowest is 55G and the highest is 300G. Is this possible?
I have 2 inventory reports: what my store has and what my supplier has. I need to copy Tab1:K# to Tab2:T# provided that Tab1:A#'s contents match Tab2:A#'s contents. The A column represents the SKU of the item, but there is a difference in the amount of SKU's in each (my store sells ~6,000 items, supplier has ~10,000 items), so it's not as simple as sort by column A and copy pasting column K to column T.
For instance: On Tab 1, A2's value is , K2's value is [9.38]. On Tab 2, A70's value is , K70's value is blank, but I need it to be [9.38], to match Tab 1's respective SKU.
I almost thought I had it figured out with VLOOKUP, but I cant seem to get it right... It doesn't reference the correct number.
Screenshots for reference
First tab, from the wholesaler: [URL] Second tab, store's stock: [URL]
Basically lets say I have in cell A1 to A10 floor access data i.e. Users who used their ID cards to access a room.
Now the data always starts with either Rejected or Admitted then the user's name and then the card number and the access floor etc. the card currently has.
What I am looking for is that the macro should first check if the cell has Rejected or Admitted written in it - this I can do myself using =Left(A1,8) which should give me the helper column I need.
Then based on this I want it to only copy the name of the individual i.e. it should look in the cell and only copy whatever is written between "Rejected" and "(Card". The cell data is something like this:
Rejected Doe, John (Card #123456) at ABC 123 Floor1/Floor2/Floor3/Floor4 Door 1 [In] [Clearance]
I have a line of code that returns a run-time error 1004 whenever it is passed through. All I am trying to do is copy and paste. I am missing some glaring error? (It is only a selection of the code to highlight the part I am having issues with. "maxdate" and "d" have been set)
VB: Dim ws, ws1 As WorkSheets Set ws = ThisWorkbook.Sheets("Data") Set ws1 = ThisWorkbook.Sheets("Target")
I have a loop function that goes through a list of employees and i want to move their name to a different sheet(monday, tuesday...) so that I know who is in on what day. is there a simple way to have it add the next name to the bottom of the list?
I have a worksheet where columns C, F, I, L, O record scores within a league. Each row records a persons score in that league and there are two rows per person recording their score and their handicap score. So Person A would be on rows 3, 4, Person B on 5, 6 etc. The persons name is recorded in Column B.
What I would like to do is to have a cell(s) elsewhere in the worksheet which show the highest score in that league and display that score and the name of the person who achieved it. This ideally would need to be done for the highest score and the highest handicap score.
For the life of me I can't even begin to work out how to do that or even know if it is possible in Excel.
So to clarify, lets say the highest score is in cell L7 and the highest handicap score was in M3. The cell(s) containing this formula should then show the name in B7 and the score in L7 and below it the name in B3 and the score in M3.