I was given a spread sheet that prepares a file for export to some ones system. The macro in the spread sheet wouldn't run as I'm using excel 2013 which when you open a new work book it only opens sheet 1 and there was a bit in the macro that wanted to send information to sheet 2 which wasn't there. I added a bit of code which created sheet 2 and hey presto it worked fine. I made the mistake of telling the people who supplied the original workbook to me what I had done so that they could pass the modified sheet on to other users in case they had the same problem.
Now I've been asked if I could do a bit more work to the existing macro so that instead of the new workbook just being called Book 1 could I add a name and date to the new workbook being created.
I've had a look at the original code and it looks like it would be quicker to start from scratch as I cant follow the original code.
The existing workbook has 3 sheets, I want to copy sheet2 to the new workbook. I want to name the new workbook as "a fixed name" with the "time and date " .xlsx
I have an Excel file which has a macro that sucks in data from a number of separate files (two Excel, a varying number of csv). The macro grabs all the individual files and loads them into one of three worksheets with some formatting, sorting, and structuring on the way. All good so far.
I then need to take two of the worksheets and copy them to a new Workbook which I can send out to some users. So I use the Workbooks.Add method, and use the Selection.Copy on just the data (UsedRange.Rows/Columns.Count to ensure it is only the data) and Selection.PasteSpecial with the xlPasteColumnWidths, xlPasteValues, and xlPasteFormats options to copy the data over. None of the data is filtered. Just straight data.
I would expect the newly added workbook to be smaller than the one with the macros because the one with the macros has two extra sheets that I don't transfer, and the sheets I do transfer are identical.
And that's where it gets weird. The file with the macros and more data is 18.7Mb, but the new one with only two sheets is 24.8Mb. One is .xlsm and the other is .xlsx (because it has no macros).
I've tried opening the new workbook and saving as .xlsm (no material difference to the size) and as .xls (it got even bigger). I've opened the new workbook, gone to the end of the data and deleted all the blank rows and columns, but no effect (because the rows are already empty).
Why would the file with less in it be so much bigger (or bigger at all)?
using Control PanelEase of AccessEase of Access CenterMake the mouse easier to use does not work as it will change mouse instead of cursor colour in excel 2013. e.g. original cursor colour in excel 2013 is green, change to any colours.
I am trying to define a font colour within a macro When I record the macro, I choose a colour from the font colour-picker in the Home section of the ribbon. The colour I choose is one of the grey shades Everything seems to work ok, and the macro saves with the colour defined as a long number, e.g.
I'm trying to print an excel workbook in a particular format. I have several sheets. I would like the information on each sheet to be duplicated directly to the right of the info, on the same printed sheet in Landscape layout. After printing, I need to be able to stack the workbook and cut straight down the middle. This way, I have two identical workbooks with identical margins, perfectly centered.
Is there an easy way to do this without copying and pasting the cell data into the spreadsheet as well?
If there is not, and I must have duplicate tables on the same worksheet, is there an easy way to format the printing so that they print out perfectly aligned?
I've tried to use the ruler function in the print page to stretch, but, it only stretches a particular row/column.
I want to select an automatic colour scheme (font) for an Exel sheet. It has 3 columns with values. If the coloums are A, B & C I want to mark the higher value in red. If B is higher than A, B should be red. Again if C is also higher than B, then C also should be red... like that. Values should be read row-wise. How can I do this using a formula?
Is it possible to import the palette whenever a new book is opened by clicking the "New" command on the toolbar? I'm aware of Workbook_Open Event, however this only works on a saved workbook. And I suppose I could use a template and open that every time I need a new book, though I was hoping to avoid this solution.
The best solution for me, that I can think of, would be to replace the "New" command with code that will 1)open a new book and 2)import the colour palette from an external workbook at a specified path. Some of you may have done something similar in the past in a more logical manner, if so I’m open to alternative ideas. My main priority is the result, not necessarily how it is reached.
With excel 2013 you're now able to open multiple windows or views of the same workbook. However when a workbook is saved with multiple windows open, the next user to open the spreadsheet will also open it with multiple windows. Which can be very annoying when most people work off of one window vs. multiple. Is there a way to disable saving the multiple windows or a macro to force open excel in 1 window?
I have a workbook with five sheets. One sheet is the Master and then one sheet each for four organizations. Each organization will populate data for their own sheet and I want Excel to automatically populate the Master with the info from each individual sheet.
I tried using and modifying the vba from this post [URL]). My workbook varies from the original in that the first seven rows are header rows so the first cell to be edited in each sheet is A8, I have 38 columns instead of 10, and I am using Excel 2013 instead of Excel 2003.
I figured out that I needed to change the vba to look like this to start copying from the first cell (A8) and to populate the master:
This seems to work, but until the first cell (A8) is populated in the organizations' sheets, it messes up the prior row on the Master (Row 7).
I've also noticed that undo becomes unavailable when switching between sheets and also copy/cut & paste between sheets doesn't work so I can't correct the way the script messes up the format initially (this I presume is due to the Copy Destination in the vba?).
I've created a macro that loads a listbox with the sheet names from another workbook. It works fine with Excel 2007-2010 but some reason fails with 2013. It doesn't crash, it just doesn't add items to the listbox nor doest it add the caption to Userform1.Caption. It does launch the form. Here is the code snippet:
Code: 'open read-only wbkpath = Sheet3.Cells(1, "f") 'full pathway to source workbook Workbooks.Open Filename:=wbkpath, ReadOnly:=True Set swbk = ActiveWorkbook swbk.Activate
In the first sheet called WSZYSTKIE (All) I input new invoices with the deadline for payment. Everyday I'm looking for invoices that I have to pay today. Dates with deadline are one column(E), dates when I paid is another one(F). I'm wondering if it is possible to do following thing:
After opening file, this would be done automatically: If there is invoice (row) to be paid in next 7 days (great if I could choose what time range I'm interested with), copy entire row to the second sheet called: Do zapÅ‚acenia (TO PAY). If there is invoice with deadline which is i.e. 2 days ago, copy whole row to same sheet and mark it RED. If it will be paid, I'm entering date at which I've paid and it should be moved to the next sheet called: Archiwum(PAID), and this row in sheet Wszystkie(ALL_ should be actualized with the date I made payment.
Excel 2013, but finally it will be used on excel 2007.
I'm back working on my estimate sheet again and hit another roadblock. I have a series of rows all separated by multiple spaces and would like to copy every one to the first empty column on a separate page sequentially until a certain condition is met (first time row starts with zero in column U, in this pic second row down would end routine).
The first column here is U on sheet "Partitions & Woodwork" so since this first row doesn't start with a zero, U10 - BC10 would need to be copied and pasted transposed into the first open column on sheet "Rebirth" (2nd pic below).
U V W X Y Z
It would be pasted transposed here from B2 downwards on sheet named "Rebirth". The next row that didn't start with zero would be pasted transposed starting at c2 and so on until the first time a row beginning at column U on sheet "Partitions & Woodwork" began with a zero (0).
The number of spaces between rows being copied varies on the partitions & woodwork sheet but the columns (U - BC) are a constant every time a row needs to be copied.
Sub Test() For Each Cell In Sheets(1).Range("J:J") If Cell.Value = "131125" Then
This works great except that it pastes formulas. I would like to paste values only. I've tried " PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False" and it gives me an error.
I'm trying to pick up the Excel application color scheme setting from code. What I want to do is set a VB.Net COM add-in form's skin based on the application color scheme so that my Add-In matches the users color settings blue/silver/black. Where is the application color scheme setting stored? I have searched the registry but with no luck and the Excel 2007 setting isn't picked up when I record a macro...
I'm not sure what I have done but one of my workbooks colour scheme has changed. When viewing the workbook cells are now grey and the lies are a lighter grey. When printing though it prnts as it would normally ie a white backgorund. It looks like the viewing colours have been reversed and I can not find out how to revery back to normal.
I want to copy the header from a previous months report and paste it to a new workbook in Excel 2007. How can I write a macro to copy from a1 to g2, keep the same column width and all formatting, then open a new workbook (trouble now in that I previously selected book1 for the new one but this could chnage), and then paste this to the new workbook, and then save this to a location on my computer? So that's, copy, open new workbook, paste keeping all formatting and values, and then save.
I have a workbook (book1) that is modifying multiple other workbooks (book2). I need to do a vlookup of a sheet in book1 from a value in book2. I then need to insert the value found by the lookup into G7:H7 (merged cells) of book2.
value is in column B of page "Routes" of book1. Found by value B3:C3 of book2. The vlookup looks in column A of book1. The found value is put into G7:H7 of book2.
In a step by step, to possibly make this more clear:
1) check value of B3:C3 in book2 2) find value in Routes sheet of book1, column A 3) upon match, grab the value of column B 4) insert that value into G7:H7 of book2
I Have a spreadsheet in which data is spreading into column A-Z. I would like to disable copy, paste, ^V,^R,^C, ^D for certain columns (Q-U) of the workbook so that user is forced to enter data manually on these columns.
1. Main (where I have a button and I intent to write code and paste the data)
2. Data (where I have data to be copied)
My code so far
Code: Sub copy() Dim wbData As Workbook Dim wbMain As Workbook Set wbData = Workbooks.Open("path") Set wbMain = Workbooks.Open("path") wbData.Sheets(1).Range("A1:A5").copy wbMain.Sheets(1).Range("A1:A5").PasteSpecial wbData.Close End Sub
In the above code the problem is that the file wbMain is already open and when I try to re-open it gives an error and program crashes and if I do not open the file then it gives me the error and says sub or function not defined as wbMain variable is not set.
Second problem:When an error is thrown or I close my files, I lose all the VBA code and module? strange ! how to save modules permanently? using Excel 2007