So right now the macro is run in every single worksheet in the workbook. Unfortunately, it appears the TRIM function erases formulas in cells. I want this macro to apply only to certain worksheets. Say the worksheets i want the macro to run on are named A1-A100.
My problem is as such; each month I receive an application for payment. This will contain around 20-30 worksheets. However I only need to interrogate around 3-4 specific ones. The worksheets I require contain data describing the plant/equipment a company has purchased, or materials purchased over a period of time. Each month the worksheets are updated with the previous months data appended to the bottom. I am required to established if the equipments have been purchased at the correct rate.
The worksheets are all protected thus in order to interrogate them I am required to copy an paste their contents into a new work book in order to format them and insert my new "assessment" columns. I need to keep the work sheets separate in the new work book as they have different layouts however they have the same layout and work sheet names each month.
I needs a macro which would allow me to open up a new book them copy the specific worksheets from a specific file into the new work book. I then have a separate macro which re-formats them into the layout I require.
I recorded a macro in an Excel Workbook which contains 65 worksheets (--this is something received on a quarterly basis for which I have no control). The macro is successful within the workbook created however, a new quarter's data may or maynot have some of the referenced worksheets. 64.9 Waiv - 1 may exists and the others (2, 3, 4, etc) not. The macro fails and prompts for Debug if a worksheet does not exist.
I used VBA codes to apply different passwords for different worksheets in a single excel workbook. They worked fine. Then i applied a password to the VBA code itself through the VBA project properties. Also worked.
But my problem is that, if any one enters a wrong password to open any of the worksheets, the VBA will open an error message window and when "end" option is clicked, the VBA code will open without any prompt for the password.Thus the entire purpose is defeated.
Sub Remove_Duplicate() On Error Resume Next Columns("a").Insert With Range("b1", Range("b" & Rows.Count).End(xlUp)).Offset(, -1) .Formula = "=If(CountIf(B$1:B1,B1)=1,"""",False)" .SpecialCells(-4123, 4).EntireRow.Delete End With Columns("a").Delete End Sub
Basically I have lots of worksheets and I want to remove the duplicates in column B for each work sheet with a duplicate entry...
I have a workbook in which I have 31 sheets. I've also recorded a macro that works great when I run it on one sheet, but it comes up with an error when I try to run it on grouped worksheets. I searched Google, and a few articles I saw said that in order to run a macro on grouped sheets, you have to use loops. I don't know if this is true, but I don't know how to run loops anyway, so. I want to run the macro on 30 of the 31 sheets. I was going to put the code in, but when I did that my post didn't work, so I'm thinking there might be a limit on the length of a post.
Cycle through all sheets in a workbook performing the following:Store worksheet protection state (bSheetProtection)... execute code ...Restore worksheet protectionI cannot seem to locate a way to save a worksheet's protection state in a variable.
I have a workbook that's setup like a form, with 30+ worksheets in it (lets say this file is called "source.xlsx"). I have information in specific cells I want pulled out in each worksheet and brought in to a new workbook called "Destination.xlsx" and listed in a row.
I have data in 2 different workbooks, and I need to transfer all data in 'Jx_ex1' to sheet1 in the 'template' workbook, and all data in 'Gr_ex1' to sheet2 in 'template' workbook. All data should be transferred to the same cell numbers, from A1 to Y5000. I actually have loads of workbooks to transfer to the template but if I have an example with the two then im sure I can work out how to modify it. All files will be in the same folder.
I have a workbook named as "DCR_Summary". In the sheet "FX", I want to get the sum of a specific column from two different workbooks named as "WNCR REPORT" and "DCCR-REPORT". The name of the column is "FXCOLL". The summation should start in row 7 all the way down where data is available. The good thing is that, my sum range will always starts at row 7 in both files but the bad thing is that the position of column "FXCOLL" is changing every day. The expected result is shown in the attached "DCR_Summary". It should pick at the same time the Sheet names where the summation came from. Sheet names is also changing and sometimes the FXCOLL is nil, hence, 0 value can be returned.
I want to run macro for copying specific cell values from worksheets according to their headers in one final worksheet of the same workbook. worksheets can go upto 30-31 ws as per the dates in the month. This would really save time and energy of copy paste.
This is the code I use to call a macro when the macro Im calling is in the same workbook.
However, I would like to call this same macro when using another workbook. I copied the macro "Clearformating" and pasted into a personal macro workbook module. However when I add this code to the sheet tab it will not run the macro.
I have a worksheet that I use to check invoice prices, which automatically indicates to me if any prices have changed, by using conditional formatting. For example, Column A contains original/current price. Column B contains new price (which I enter by hand and is calculated to round off, etc via other cells). If the price changes in B, a simple formula in Column C shows the new price and uses conditional formatting to turn the cell yellow so I can see that it needs to be changed in our system. However, we also must account for shipping charges on our invoice - which change with each order. So, when calculating new price, I also add shipping costs. This same setup repeats for every row of items.
My question: if I change the shipping, but only change the prices on a few rows, the prices on ALL the rows change because of the new shipping. Is there a way to say, select that only certain cells were (received with new price) and have the changes apply to only those cells?
Row 1 Cell A: current price including shipping from last invoice (which is calculated in several other cells to include shipping, round off, markup, etc) Cell B: changed price (from invoice) Cell C: compares A and B using =IF(F9<>H9,H9,"") and applies conditional formatting if price changed.
Row 2 (repeats)
If we only get a new order of row 1, the shipping changes. But I DON'T want row 2 to change it's price, since the price did not in fact change.
So basically, what I want is to be able to check off, or select, only the rows that come with latest invoice.
I attached a sample worksheet. Excel Forum example.xlsx
Sub display_all_false() With Application .DisplayGridlines = False .DisplayHeadings = False .DisplayOutline = False .DisplayZeros = False .DisplayVerticalScrollBar = False .DisplayWorkbookTabs = False .DisplayFormulaBar = False .DisplayStatusBar = False .ShowWindowsInTaskbar = False .CommandBars("Standard").Visible = False .CommandBars("Formatting").Visible = False .CommandBars("Control Toolbox").Visible = False .CommandBars("Drawing").Visible = False End With End Sub
But, when I run the code, seems there're run-time errors detected at these codes: .DisplayGridlines = False .DisplayHeadings = False .DisplayOutline = False .DisplayZeros = False .DisplayVerticalScrollBar = False .DisplayWorkbookTabs = False
1. Is there any way to correct these codes? 2. Does the bolded codes applied to ActiveWindow (Worksheet) only (eg. With ActiveWindow ...)? Can I change it to ActiveWorkbook (perhaps)? 3. Can the command menus (File Edit View Insert Format ...) be hidden also? 4. Does looping method for each worksheet
I need a macro that will perform a set of oprations on all worksheets in a workbook. The names and number of worksheets will not always be the same. I have found several macros that look like they will do this, but when I try to add my code they don't seem to work.
I am trying to modify the macro that I have put together so that it executes only specific worksheets within a single workbook. In this example, I would like the macro to update worksheets A, B, and C but I have more sheets in my actual file. I am only able to get the macro to work on the active sheet. Attached is my workbook.
VB: Sub HideColumns() Application.ScreenUpdating = False Dim myRange As Range For Each myRange In Range("B5:M5")
I inherited a price list workbook made up of multiple worksheets (some 30 pages). Each year the new prices (including % increase) are calculated by a formula in the row below each price (100's of rows and formulae).
Thus: C1 might say £10 D1 says =C1+(C1*2.5%) £10.25 (it actually does some rounding too) etc
It may seem odd having both rows but MD can see the before and after. The new price 10.25 must however be manually copied to C1 to avoid circular referencing and then D1 row hidden. Very laborious to repeat 100's of times.
Is there a way of first copying the entire workbook for the new year (easy) then by means of a macro looping through each formula cell of all sheets in workbook 1 and pushing the result to the new workbook and to the correct sheet and then to the same location but to the cell above. e.g. pushing £10.25 from D1 of sheet 1 workbook 1 to C1 of sheet 1 workbook 2 to become the new price for the coming year?