Macro For Splitting Worksheets But Excluding Certain Ones

Feb 7, 2013

I have a workbook with multiple worksheets, for instance Red, Blue, Green,Orange, etc. I want to split off everything except Red & Blue into separate workbooks.

I want each of the workbooks name to be saved as the value in a specific cell (stays the same for each book), say "A2". I also want to be able to choose the path of where to save these, all worksheets going to the same path user chooses on their comp, but each user may choose differently.

And lastly to keep these actions hidden from the screen when excel copying the worksheets.

View 4 Replies


ADVERTISEMENT

Excluding Data From Worksheets?

Jul 17, 2013

I've been asked by one of our Managers to generate a report on stock that hasn't been sold for x amount of time. Unfortunately with our accounting package the report I run also includes stock that we may have purchased recently but have not sold.

So what I did was generate a report for stock that hasn't sold in the last two years(NOTSOLD), and then a report for stock that has been purchased within the last six months(PURCHASED). I've put both of these reports into two worksheets.

What I'd like to do now is match up stock codes across the two worksheets and exclude the PURCHASED stock from the NOTSOLD stock.

My Excel knowledge is limited but to put it in beginners terms I'm basically looking to do a reverse VLOOKUP.

View 1 Replies View Related

Average Over Worksheets Excluding Zeros

Dec 14, 2009

im trying to average over a number of work sheets to determine the avergage talk time of employees over a day, ive tried:

View 14 Replies View Related

Splitting Screen Within Workbook To See Two Worksheets Simultaneously

Jan 18, 2006

I am working on a document at work with multiple worksheets. It would be most useful for me to be able to split the screen so that I can work on both worksheets at the same time without (a) having to switch back and forth, (b) modifying the workbook so that everything is on one sheet, or (c) opening the file twice and sizing the windows to my screen.

My goal is to be able to see the information on each sheet while modifying one sheet or the other.

View 9 Replies View Related

Splitting Large Table Into Separate Worksheets Keeping Format Same

Apr 26, 2013

I have 2 large XLS sheets that need to be split into seperate sheets.

The first is only 5 columns wide but the amount of rows changes day to day.

The second is a maximum of 7 columns wide and again the amount of rows will change.

I'm hoping for a VBA code to be able to do both on seperate books.

The A Column has the name of the company, and this can include (/,&) that will need to be removed, the names can also exceed 31 characters.
I would like to seperate the sheets by the company name and have the name appear as the sheet name.

Also the formatting from the master sheet to be copied to the resulting sheets, with a header row.

I have included the data for the larger of the two workbooks. data.jpg I have to pull the smaller report each day and the larger report each week.

View 3 Replies View Related

Macro For Splitting Data From Cell That Has More Than One Value In It?

Dec 5, 2013

Each row in my spreadsheet is a record. Unfortunately, for one cell, the data base that the info came from has in more than one piece of data in a cell in the data dump into Excel for that record. Each piece of data in the multi data cell is seperate by a ctrl enter hidden break.

I need a seperate record tied to the original record for each item in the multi data cell so that I end up with a flat file with unique records and data on one row.

Is there a way to do this other than manually? I'd like to have a macro since I run into this quite often depending on the client.

View 1 Replies View Related

Macro - Splitting Sentences In 2 Columns?

Apr 29, 2014

i need some macro code to split a sentences become 2 string/text, like this below :

assuming start data in col.a

sample raw (col.a)
after macro (splitting 2 text)
The Internet and media are closely controlled in China
The Internet and media are closely controlled in
China

The crackdown hit Chinese Internet stocks
The crackdown hit Chinese Internet
stocks

You can feel the pressure in Doha
You can feel the pressure in
Doha

It exploits data left in memory after an operation
It exploits data left in memory after an
operation

etc..

it's possible splitting a sentence become 2 string/text in 2 column (col.b & col.c as desired result). in col.c result based on last word a sentences..​

View 7 Replies View Related

Rotate Data Excluding Empty Cells Using Macro

Jan 16, 2012

First I will post the data:

Weekly Roster

F98AKHTAR99DEEPAK100NAPA'A101OUKASH102ROBINSON103RUSSELL104SALUNI105S
PARTIATIS106SPICE107TAN108TORRES. Jr109VAN STEEN110ACCIARITO111112113114115116117118119120

In this data, as you can see there are a lot of cells/rows that are empty. I have a macro that will copy the cells F98:F120 to F99:F121 and then copy F121 to F98, and finally delete the value from F121. In this case, it will give me a blank cell at the top and the data hasn't rotated really. All the names will be in same position.

But I DON'T want that. I want the macro to look for the last cell/row with a valid value in it and rotate the cells so that I end up having ACCIARITO at the top and everybody else to move down one row.

View 6 Replies View Related

Macro To Print Active Area Excluding Cells With Forumula That Doesn't Return Value

Dec 20, 2007

Trying to put together a macro that looks down active sheet for all cells that contain a value, sets a print area and then prints !

Is this possible?

FYG, I have a column that run from 3 - 2000, which contains a formula, which may produce a value depending on corresponding cells.

I used this code from a post on a similar topic, but excel is complaining code
in bold

Private Sub Print_Area_Click()
Dim lastCell As Range
Set lastCell = Cells.SpecialCells(xlCellTypeLastCell).Offset(1, 0)
Do Until Application.Count(lastCell.EntireRow) 0
Set lastCell = lastCell.Offset(-1, 0)
Loop
ActiveSheet.PageSetup.PrintArea = Range(Cells(1, 1), lastCell).Address
End Sub

View 9 Replies View Related

"Macro" For Splitting Data Into Separate Sheets

Aug 15, 2003

Scenario: Master List, which has all the U.S. states in it.

What I Need to Do With It: Divide out EACH state's information and put it on a seperate worksheet.

I've only recently started using macros (to format various documents for easier printing), but now that I'm starting to understand them conceptually, I'm thinking there Should Be some way for me to program a "macro"-type thing to run on the master list and come out with all my state lists, looking beautiful in seperate files.

View 9 Replies View Related

Macro To Move Between Worksheets

Apr 4, 2014

I have a work book with 6 worksheets, sheet2 is called Maersk, sheet3 Mariana, and so on ....

I need a macro so when I type Mariana in sheet1 g20 and hit enter it go's to Mariana sheet .....

View 5 Replies View Related

Deleting Worksheets With Macro?

May 2, 2014

I am trying to write a macro that takes the value in cell B2 from a workbook called ""numbers" in a worksheet called "summary," and creates a new worksheet in a workbook called "filestransfer" that is named the same thing as the value in cell B2 from "numbers." That part is done.

View 2 Replies View Related

How To Make Macro Run In All Worksheets

May 21, 2014

How do I make my macro tun in a loop through all sheets?

View 10 Replies View Related

Macro Not Reaching All Worksheets?

Jun 6, 2014

The ConsolidateLiveData macro only appears to check worksheets up to '2300-2399'. Any tabs after that, which are coincidentally numerical, aren't captured in the summary 'Live' worksheet. There is data on worksheets '2400-2499', '2500-2599' and '2600-2699' which meets the criteria to be included on the summary but it's not appearing.

Is there a limitation on the number of worksheets a macro can check?

View 6 Replies View Related

Macro Which Uses Two Worksheets At A Time?

Feb 6, 2014

how to record a macro and use 'relative referencing'

I have written the macro and I can reach a stage where it does the job and highlights the area (cannot get the formatting, but I can live with it).I have attached the file.I am getting stuck in copying the data to the adjacent sheet 'xxx'.

View 4 Replies View Related

Apply Macro To All Worksheets

Dec 2, 2009

I need to run the below code on all work sheets:

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...

View 9 Replies View Related

Locking Worksheets With A Macro

Dec 8, 2009

I found the following code which allows you to lock sheets 1 to 3 with the ActiveX control buttons located on Sheet4.

View 8 Replies View Related

Run Macro On Multiple Worksheets

Jun 6, 2008

I have a macro that works well for me. However, I want it to run on multiple worksheets in my workbook, but can not get it to work. Is there an easy way to accomplish this?

View 9 Replies View Related

Copying Between Worksheets With A Macro

Mar 20, 2013

I have 2 worksheets. The first worksheet contaions raw data. On the second worksheet I am pasting certain data from the first worksheet. Everything copies except the data in column BI. This column has blanks as well as numbers. I need the column copied as is. The range should equal the number of entries in column A. Why am I getting the error, and Is there an easier way than what I'm using?

Sheets("Raw Data").Select
Range(Range("A4"), Range("A4").End(xlDown)).Select
Selection.Copy

[Code].....

View 5 Replies View Related

Macro That Changes Worksheets Not Specific One?

Apr 16, 2013

I have tried Sheets("").Select to just have the macro work on any worksheet in a workbook not just on the specific worksheet (i.e.Sheets("4474-60-2").Select . Get an error though.

View 9 Replies View Related

Macro To Modify Several Worksheets

Jun 21, 2013

Due to the lack of time and not being able to make it work otherwise this is what I have right now:

If Range("g59") = 1 Then

Sheet1.Activate
Application.Run "Edit_view"
Sheet3.Activate
Application.Run "Edit_view"

[Code] ...

There was a formula to enter sheets names in a cell range (ie: A1 would have value SHEET1, A2 SHEET2, etc) and use a FOR loop to cycle through the named sheets.

View 1 Replies View Related

Restrict Macro To 2 Worksheets Of 5?

Nov 8, 2013

I have a ctrl-q key activated macro (module 2) that successfully clears specific data entry cells in forms on two identically formatted sheets. How do I prevent access to that macro on the remaining three sheets of five in the workbook?

View 2 Replies View Related

Macro: Switch Between The Two Worksheets

Jul 12, 2007

If I have an excel workbook open and then, select the side-by-side option to open another workbook, and I want to write a macro that will switch between the two - how can I do this? The problem is, I don't want it to switch by file names (one workbook constantly changes names), I just want it to switch between active workbook and inactive workbook.

Once I have the code to switch between active workbook and inactive workbook, how can I have my macro look at a cell and see if data is present and if so, drop down to the cell below.

Windows("Job Number Request form.xls").Activate
Range("C9").Select
Selection.Copy
Windows("Backup Copy of 2007 Capex Job Log.xls").Activate
Range("E570").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

View 9 Replies View Related

Macro: Selecting All Worksheets

Jul 16, 2007

I am currently working on a simple macro to help with formatting a spreadsheet. The number of tabs on the spreadsheet will change to reflect the number of companies I'm running reports for. But the same process is to be applied to each tab. The issue I'm facing is I don't know the appropriate code to select all tabs without specifically referencing them.

The code that I would like to apply to all tabs is as follows:
ActiveSheet.PageSetup.PrintArea = "$A$1:$J$85"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""

View 9 Replies View Related

Macro: Create & Name New Worksheets

Sep 30, 2008

I have a workbook that is tracking part-time faculty appointments. Names and appointment details are entered on the first worksheet ("Entry"). I have another worksheet that pulls data from Entry to generate a summary of the salary for each appointment. Right now, this worksheet is called "Template" that needs to be copied and renamed for each appointment entered.

So, Entry could have up to 56 columns of data entered. There are nearly 100 rows of information for each entry (portrait-style for ease of printing). Columns A and B are information and will not have any entries. Column C is the starting point for the entry of appointments. Cell C5 will have the first appointment Name.

What I want is to create a macro that will copy the Template worksheet as many times as there are names entered from C5 and beyond (D5, E5, F5, etc.) When it creates each new worksheet, I want it to rename the new worksheet with the contents of row 5. For example, if "Smith, J." (without the quotes) is entered in C5, I want a copy of the worksheet Template called Smith, J.

The renaming of the sheet is important because I have a cell in Template that pulls the worksheet name, which is then referenced by cells in Template to pull the information pertaining to that appointment.

What I have seen here on Mr.Excel is a macro to rename a worksheet based on a specified cell, and I've seen something that looks like it created new worksheets, but I haven't seen the two put together like I'm looking for. I am also not that adept at the VBA, so I haven't really been able to figure out how to cobble it together myself.

To summarize:
- I have two worksheets: Entry and Template
- Names are entered into cells (C5, D5, E5, F5, etc.) on Entry
- I need to copy Template as many times as Names are entered and rename each new copy with that Name (also, new sheets should be generated at the end (right) of the current list of worksheets)
- The whole process can be activated by a button on Entry

View 9 Replies View Related

Run Event Macro On Two Worksheets

Oct 16, 2006

The macro below works great as a conditional format routine on the Input sheet of the workbook, however I would like it to run on the Data sheet as well, but with a different range (E3:CE117). Can this be done?

Private Sub Worksheet_Calculate()
Dim dcell As Range
Dim icolour As Integer
For Each dcell In Range("c15:g27")
Select Case dcell.Value
Case "GA"
icolor = 43
Case "GAC"
icolor = 4
Case "LA"
icolor = 45.....................

View 7 Replies View Related

Macro: Hide Worksheets

Nov 23, 2006

I have an Excel spreadsheet from which I run a macro to open another workbook. This other workbook has multiple worksheets. The problem I have is that I never know which worksheet was left active whenever it was last saved. How do I revise my macro to open this workbook and make a specific worksheet active and hide all other worksheets?

View 9 Replies View Related

Macro To Get Comments From All Worksheets

Feb 10, 2007

I am trying to find out if it is possible to do the following

I have an excel workbook with comments in a number of worksheets. I have created a macro so I can list the comments and the value of the cells with comments. The macro creates a new worksheet and list the comments and value this great but I can only get it to create the comments from the sheet which is active. Is there a way of getting all the comment and cell value from all the worksheet (the entire workbook)

this is the code for the macro

Sub shoppinglist()
Application. ScreenUpdating = False

Dim commrange As Range
Dim mycell As Range
Dim curwks As Worksheet
Dim newwks As Worksheet
Dim i As Long

Set curwks = ActiveSheet

On Error Resume Next
Set commrange = curwks.Cells _
.SpecialCells(xlCellTypeComments)
On Error Goto 0

If commrange Is Nothing Then
MsgBox "no comments found"
Exit Sub
End If ...

View 6 Replies View Related

Macro To Search All Worksheets

Jul 30, 2007

I've been writing a little macro to prompt a user with a form which lets them select 2 reports to open and also lets them select a month. One report contains financial data for the month and the other report contains all data for the year. So each month someone has to copy data from report 1 into report 2.

I have so far been able to:
-create form with error handling to open files
- select values from a pivot table in report 1
- search pivot table 1 (single sheet) and copy the Name and Total $ fields

what i haven't been able to do:
When i get the data from report 1 I switch to report 2. When i get to report to i need to search all the sheets in order to find a name with the original Name field from report 1 (I then have a HUGE case statement that will tell me if name = this and month = that then paste in cell $x$y). However, whenever i try to run my search across all sheets it will only find values on the sheet that is selected at the time.

I've attached my search code below, I would appreciate any help i can get as I've spent all day trying to resolve it with no luck

Function findinworkbook(TruncName)
Dim ws As Worksheet

On Error Resume Next

For Each ws In ThisWorkbook.Sheets
' Find Function
Cells.Find(What:=TruncName, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.ClearComments
ActiveCell.AddComment
ActiveCell.Comment.Text Text:="test" 'test to mark where the matched cells are
On Error Goto 0

Next
End Function

View 5 Replies View Related

Run Macro On Multiple Worksheets

Sep 28, 2007

I have a excel macro that I am trying to use with multiple worksheets within the same workbook. The code runs fine on "Sheet1". However, when I click on "Sheet2", and try running the code I get an error message because the data is trying to be placed on "Sheet1".

Here is my

Sub Organics()

'The code under this section setups up the columns and rows

Range("B1:D1").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved