Copying Cells Then Save As Separate Workbooks - VBA Code
Oct 1, 2012
I need to copy a range of cells from various columns/rows from 1 sheet into 6 other sheets, but into a specfic range of cells(in the same workbook). I am looking for a code which would copy the cells, then allow me to save the sheets it has copied them to as seperate workbooks without loosing the values it copied. I would also like to make amendments to the cells which have been copied onto the other sheets, without having an error message if I type anything into the cells, also having any blank cells left blank rather than placing the 'o' value in the cell.
View 2 Replies
ADVERTISEMENT
Dec 6, 2009
I have a workbook which have worksheets say A to J. I wanted it to be separated into 10 different workbooks A.xlsx, B.xlsx, C.xlsx and so on in drive C. Could anyone help me here?
View 6 Replies
View Related
Sep 17, 2013
I am looking for the VBA code to copy worksheets (with formatting) and save to a specific folder. The steps I am need to follow are:
Create a copy of the first worksheet
Save it to a specified folder and name it with the worksheet name
Repeat with all worksheets until the end of the workbook
View 3 Replies
View Related
Sep 23, 2013
The current macro I have allows me to save 'sheet 2' as the name in cell sheet1 B2, which is a 6 digit number. I now want it to save as data from 2 cells, sheet1 B2 followed by sheet1 B1, which is job name (eg. 112233 microsoft excel).
This is the current formula I have:
Public Sub saveworkbook()
Dim filename1 As String
Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True, _
IgnorePrintAreas:=False
Sheet1.Select
filename1 = Range("b2")
ActiveWorkbook.SaveAs filename:= _
"C:UsersAndrew.SDocumentsInterloc DocumentsHardware Sheets" & filename1
End Sub
View 2 Replies
View Related
Aug 9, 2007
I am creating a macro to copy data from one workbook that is emailed to me to another workbook that contains the actual macro, I will be using the second workbook to import the data into an application.
What I need is to be able to copy text in cells say D1, D3, D6 etc located in workbook1 to cells say A1, A2, A3 etc in workbook2 without having the macro go back and forth each time to copy the cells one at a time.
Also is there a macro that will recognize an already open workbook that I can use to copy the data
View 10 Replies
View Related
Dec 17, 2008
I have 194 Workbooks that all contain data on the first sheet only. I need to go into each sheet and pull the information from cell B6 and F21. That information needs to be copied to a new workbook into columns A and B so when I am done I have 194 lines in two columns.
Each of the workbooks I am pulling from have the info I need in Sheet1.
Is this possible, or do I need to do a lot of copying and pasting? If it is possible, how do I do it?
View 9 Replies
View Related
Feb 25, 2013
I have 10 very large workbooks that are all setup in the same format. In column Z is a numerical value from 1 to 83. I have been trying to filter the sheet and then copy one at a time from 1 to 83 but that takes a LONG time especially when there is 10 workbooks to do.
Is there anyway I can run a function or macro or something that would just automatically look down the column Z and put each row into a it's own workbooks?
I have attached a sample of what the workbooks look like right now.
Sample123.xlsx
View 4 Replies
View Related
Apr 23, 2014
I need to separate row data from one workbook into separate workbooks based on cell data. Currently I filter the data, copy and paste it to a new workbook and save it. It's a tedious process and was hoping to find a way to automate it. I have attached a sample file. In this instance, I would like a separate workbook for the filtered data in Column 1 and then all the row data gets copied to new workbook. So all of Pennsylvania data would get copied to new workbook, then all of the Michigan data gets copied to a new workbook. I have also attached an example of the end result that I need.
View 9 Replies
View Related
Feb 20, 2013
I've attached a sample workbook in which there are 3 macro-buttons.
The buttons will paste a shape in the active cell. So this means the buttons themselves could be deleted and replaced with a shape.
Since locking and then protecting the cells disables the macros, how can I amend the code to make sure the buttons' cells are protected from the copying and pasting macros? Or, how do I ensure that the macros only work in A1 - E5?
View 4 Replies
View Related
Sep 11, 2007
I am trying to do some calculations as shown in the file. The MAcro has to show the formulas and then calculate the value, the problem is that the formulas change all the time and depends of Column A. Column A defines de Values that we will use so they will change as well. I have fould the way to copy one formula and make it usefull in the cell next to it but the problem are the cells that I named before. All my values change in each Loop and finish with the values of the last loop. I would like to save each value that corresponds to the variable (column A) and his formula, to then calculate.
View 4 Replies
View Related
Mar 19, 2008
I want to create a macro that saves my file this way:
in a folder named after B2
and
as a file named after B4n.
View 4 Replies
View Related
Feb 24, 2014
Trying to manipulate a macro I recorded to be slightly more dynamic with some VBA code. The macro has saved me a lot of time however each month I have to re-do it due to the date changing and I'm sure there must be an easy way to adapt the below code.
Current Code (it repeats afterwards as there are lots and lots of sheets I need to perform the action on).
Windows("Raw Data.xls").Activate
ActiveWindow.DisplayWorkbookTabs = True
Sheets("Calls").Select
Range("C43").Select
Selection.Copy
Windows("Volume Tracking.xlsm").Activate
Sheets("Offline").Select
Range("AE33").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
What I'm after is a way to alter the range highlighted based upon matching a cell in "Raw Data.xls' and a cell in "Volume Tracking.xlsm".
The cell A43 in "Raw Data.xls" contains a month (which changes every month); if the month is Jan then I would want the Range to remain as AE33. If it's Feb then I would want the Range to be AF33 (and so on).
In "Volume Tracking.xlsm" I have the months in cells AE4 (Jan), AE5 (Feb) etc.
Is there a way to locate the column in "Volume Tracking.xlsm" on row 4 that contains the value found in A43 in "Raw Data.xls" and then paste what was copied out of "Raw Data.xls" C43 and paste it in to row 33 of the correct column that holds the matching month?
If not could I add code to say if cell A43 in "Raw Data.xls" = Jan then paste to AE33, if Feb then paste to AF33 and so on.........
Excel 2007
View 9 Replies
View Related
Mar 28, 2013
I have 24differnet workbooks each with one sheet with data. Each sheet has the sae headers with differen amounts of info under the headers. I am looking for a quick way to get all 24 sheets in to one workbook instead of copying and paste.
View 3 Replies
View Related
Nov 17, 2008
I have 2 separate workbooks and I would like the Vlookup function to look for the value in "DO" after matching the both "Job Sheet". I have attached 2 files for better understanding.
View 4 Replies
View Related
Dec 3, 2013
I'm trying to use a formula in conditional formatting to highlight a cell red if the cell contains a 0 but the date shown in another cell has passed. I want to copy the formatting throughout a column but I don't want the cell to highlight if there is no date in the other cell concerned.
View 11 Replies
View Related
Feb 20, 2009
I am trying to find a way where I can just enter the information into one and have it flood to the other.
worksheetA is the master sheet which contains data on all accounts - the order and number of entries on this account changes monthly.
worksheetB shows data only on a single account.
What I am looking to do is to take the account name from worksheetB find the data I entered in worksheetA and have that flow to the apporitate cells in worksheetB.
Something like this
cell on worksheetB displaying number of vehicles - if worksheetB(cell with the account name) = worksheetA(range of cells with multiplenames) if the two match somewhere on the list then display the number of vehicles from a cell in another coloum same row.
sorry if its confusing, tried my best to explain it. I'm sure it can be done with VB but just don't know that one much, is the syntax and language similar to the old ms basic?
View 7 Replies
View Related
Sep 26, 2013
I would like to separate data into multiple workbooks based on a unique value in the column. For instance if I have Departments in Column F, that has data of accounting, HR, etc. I would like to put all accounting data into a accounting workbook and all HR data in a HR workbook.
View 4 Replies
View Related
Dec 1, 2009
I have 2 workbooks open and I want to set up formulas from one linking to the other. When I toggle on the task bar between the 2 workbooks they replace each other within the same window so I can only see one workbook at a time. How do I set it up so I can have 2 separate windows open at the same time, one with each workbook in it? I tried 'side by side' in one window but the viewing area is too small.
View 9 Replies
View Related
Sep 14, 2006
I have a workbook with multiple sheets and I want to make these sheets into separate workbooks. I need them to be saved in the same path as the original workbook and automatically named (same filenames as worksheet names). I tried a code from a VBA book, and I got "Object needed" error message.
View 3 Replies
View Related
Feb 18, 2014
I have workbooks based on the date. Here is an example "Daily Numbers Report - Summary_2014_02-18-06-02-30"
All of the files are formatted this way. Then, in a master file I have dates going horizontally for the entire year in the following format Tue Jan 15, etc. How could I do a lookup that would grab from all of the open files and match the date BUT subtract 1 day from that date for all the lookups, so Feb 18 would look at 2-17?
View 5 Replies
View Related
Jul 7, 2009
I have a large workbook with many worksheets which are all grouped into pairs - i.e. Sheet1 & Sheet2 go together, Sheet3 & Sheet4 go together; Sheet5 & Sheet6 go together, etc. etc.
I need a macro to divide this workbook into separate workbooks where each group of worksheets has a separate file of its own and I want to name the new workbooks after the second sheet in each group:
i.e. A new workbook for Sheet1 & Sheet2 called Sheet2.xls; a new workbook for Sheet3 & Sheet4 called Sheet4.xls; a new workbook for Sheet5 & Sheet6 called Sheet6.xls; etc. etc. etc.
View 12 Replies
View Related
Nov 20, 2007
I have 5 worksheets in file Z on drive J which are full of VLOOKUP formulas pulling data from several files on drive K. Each worksheet pulls data from it's own file on drive K...ie, worksheet AB pulls all of it's data from file AB_2008, etc. On worksheet CD there are two rows which populate with #N/A when I open file Z, but if I open file CD_2008, the #N/A's automatically populate with the correct values. Any ideas??? I am not a programer but I have pretty fair excel skills...but this one has stumped me.
Here's my formula:
=VLOOKUP($A19,'K:sopworkbookssop_2008[sop_2008_rt.xls]11-RT-PPR'!$A:$BQ,C$34,FALSE)
View 9 Replies
View Related
Mar 12, 2008
I have created a workbook for a co-worker. The way it works is data comes from an outside source with customer names in Column A and their Account Reps in Column H. This data is pasted into a template that I created with a very simple macro recording that filters on each Account Rep and is copied and pasted each into a different workbook. Then I had to go through each workbook (because of the info being sensitive) and create a macro that deletes the unwanted data because when the data is pasted it transfers all of the data and you can unfilter to see the full sheet.
I know there is a better way to extract data on each change in column H into a new workbook. Does anyone know how to do that? Another issue is the original data is not very clean so there are blank rows in the list. For Example:
CustomerTechnology SegmentOpportunity Dollars ($)Opportunity StatusAction Item(s)(ST) or (LT)Due dateAcct RepCustomer 1Action 1ST3/30/2008ACCustomer 2Technology 1Action 2LTTBDACCustomer 3Technology 2$10,000FindAction 3LTTBDACCustomer 4Technology 3FindAction 4LTTBDBHCustomer 5Technology 4FindAction 5LT1/31/2008BHCustomer 6$30,000Action 6LTTBDBHCustomer 7Action 7LTTBDMJCustomer 8Technology 5$10,000QualifiedAction 8ST3/1/2008MJCustomer 9Technology 6QualifiedAction 9ST2/28/2008CGCGCustomer 10Technology 7$18,000FindAction 10ST3/1/2008CGCustomer 11Technology 8$10,000QualifiedAction 11ST3/30/2008BHCustomer 12Technology 9FindAction 12LTTBDACCustomer 13FindAction 13LT3/15/2008AC
View 9 Replies
View Related
Jul 16, 2009
If the name in Column F of "Sheet1" is found in "DataPEs" in Column B, then copy the block of 6 cells of data below it in column Q to column D of "Sheet1" in their relative rows. Additionally, if column Q has data then copy it, if not then copy the data only in column M. Finally, the number of matching names will vary in Sheet1 but will stay mostly the same in the DataPEs sheet. I've highlighted one block of data in green as an example.
View 13 Replies
View Related
Nov 16, 2011
I'm trying to automate a search and match function between two separate workbooks using VBA and am having some problems. I'm using the following line:
search_results = Application.Match(temp, Range("E1:E900"), 0)
which works fine. now the problem is that when i'm searching for lets say "ABCD" in one of the workbooks, if there is an entry "ABCD " (with a space at the end) it says that the entry doesn't exist. is there any way of correcting it such that it would always neglect the space at the end if it exists? i tried using -1 instead of 0 and it messes up, so i'm not sure what to do.
View 2 Replies
View Related
Sep 12, 2013
I'm linking some data from 2 workbooks in the same folder (using excel 2013)
I have a main rota that works great, called "Main Rota.xlsm" I then have a separate basic file called Email Rota.xlsx without all of the bells and whistles of the Main Rota, purley made to email out to staff.
I store both files in the same folder "Site Rota" and it works fine.... until I rename the folder or move the folder to my laptop.
The link in the Email Rota looks like so to start (calling cell A3 from the Main Rota) ='[Main Rota.xlsm]Planning Rota'!A3
As I said it works fine until I move the folder onto my laptop the link then changes to
='D:DesktopSite Rota[Main Rota.xlsm]Planning Rota'!A3
And I have to keep updating the link, I have read online that it isn't supposed to work like this and its supposed to read the file "cleverly" in the same folder ?
I would ideally like to keep both files in the same folder and to update from visa versa without having to update the links if I move it from PC to laptop with I do daily .
View 1 Replies
View Related
Feb 26, 2014
Using VBA, I am trying (without success) to copy the active worksheet of my workbook and save it in the current folder using a filename shown in cell A1. I only need to save values and formats. Any existing code (auto fit) contained withing the sheet would no longer be required. I get a VB project message relating to macros. I would anticipate saving as xlsx would deal with this but again, am at a loss.
View 4 Replies
View Related
Feb 13, 2014
I'm trying to separate text from numbers into two separate cells...
Essentially, I would like the users to copy and paste data into Column A, as seen below. Then, hopefully by formula separate the text characters into Column B and the numbers into Column C.
Input: Output 1: Output 2:
Col A Col B Col C
Wells 123 Wells 123
Wells 1234 Wells 1234
Wells Fargo 123 Wells Fargo 123
Wells Fargo 1234 Wells Fargo 1234
Wells Fargo Inc 123 Wells Fargo Inc 123
Wells Fargo Inc 1234 Wells Fargo Inc 1234
Ideally, I would like to do this with a formula...
View 6 Replies
View Related
Feb 24, 2014
I have a workbook with two sheets the first one is called "SDL" contain master data for three TEAMS (TEAM.A, TEAM.B & TEAM.C") and the second worksheet is called "SDL_Calendar" for graphical chart view.
I need Macro to copy the relevant column data from "SDL" sheet and paste into appropriate column in "SDL_Calendar" sheet then make separate sheets for each "TEAM".
I have attached the work book of what I am trying to accomplish.
View 6 Replies
View Related
Dec 19, 2012
I am working on an excel spreadsheet that has multiple "sheets" to it. On the first sheet I have multiple columns worth of info and on the second sheet I am trying to copy some of the info from the first sheet.
For example:
Sheet 1, Column A2 has the number 1 in it.
On sheet 2 I have entered the command "=SHEET1A2" and it copies the info as I had hoped.
However, here is where my issue comes into place.
When I sort Column A on sheet 1 numerically, my answer on sheet 2 changes to whatever the new number is in box A2 on sheet 1.
Is there a way I can copy the info so that it changes as I sort the column numerically or alphabetically?
View 1 Replies
View Related