I am looking for a way to find if a AlphaNumeric (like "21 02D") reference in column E on sheet 1 and compare if that Alphanumeric is also on a table on sheet 2.
If there is a match then highlight that row on sheet 1 from A:N.
And then continue to the next number in column E and repeat.
My VBA program uses a named range("MyRange") to access data on Sheet1. Next month I want to copy Sheet1 to Sheet2, update the data for the new month and rerun the program. Now, of course, I want "MyRange" to refer to the range on Sheet2 instead of Sheet1. Is this possible to do or do I have to define a new named range each month?
This is more acedemic than anything, but I'm trying to create a range that refers to ranges on more than one sheet... is this possible? "Union" doesnt appear to work when the ranges are on different sheets. Netither of the Set My_Range3 statements work below.
Option Explicit Public Sub test() Dim My_Range1 As range Dim My_Range2 As range Dim My_Range3 As range Set My_Range1 = Worksheets(1).range("A1:A10") Set My_Range2 = Worksheets(2).range("B1:B10") 'Set My_Range3 = Union(My_Range1, My_Range2) 'Set My_Range3 = range(My_Range1, My_Range2) My_Range3.Interior.ColorIndex = 3 End Sub
Both Set My_Range3 statements will work if the ranges are on the same worksheet.
I have a workbook with large number of sheets (150+). All sheets have the same column structure (same number of columns with same heading in Row 1), but the sheets vary in the number of rows.
I am looking for a VBA (Macro) that copy (combine) the same range (d2:g6 from each sheet) into a new sheet stacked.
I have a code that copy and paste a productlist into one sheet.
Is it possible to do this for three sheets all in one operation? I have read about the grouping, but doesn't that affect the whole sheet, so if I write something in one sheets cell, it will be sent to the others at the same time?
Code: Sub CopyProductlists() 'Set **** = Worksheets("Sheet1") RAnge("B1").Select
I have a work book with 2 sheets and am trying to compare 2 columns in sheet 1 with 2 colums in sheet 2. In both the sheet one column among the 2 is off date and other one is some numbers.
I am looking for formula or macro which would compare the cols and highlight if date is common in sheet 1 and 2 and if so then it should compare the corresponding number from sheet 2 to sheet.
I am aware the above can be done using vlookup but in my case the numbers in sheet 2 are not exactly same. it would be withing a range of +300 to -300. Below is the example
Sheet 1
B C
1-Feb-13 394,907.66
[Code] ....
Sheet 2 K L
394709.5 1-Feb-13
3,222,800 1-Feb-13
In the above example when we compare 1-Feb-13 is common in both the sheet and data when compared it not exact but in the range of (+300 to -300) so these should get highlighted, not to forget even exact value should get highlighted.
I'm pretty new to coding from scratch in VB, and I've got some code that should loop, but it doesn't. The idea eventually will be to download a spreadsheet, make a new sheet for every item in a range, and then filter for each of those items and put it in the right sheet. I have to code to create the sheets (lightly modified from something I got here)
Sub CreateSheets() 'Written by Barrie Davidson For Each c In Sheets("FilterList").Range("b2:b74") Sheets.Add ActiveSheet.Name = Right(c.Value, 30) Next c End Sub
That's working well, so I've tried to modify it so that it will also delete sheets based on the same range. I've gotten it to delete the first item in the range, but then it stops.
For Each c In Sheets("FilterList").Range("b2:b74") Application.DisplayAlerts = False Worksheets(c.Value).Delete ActiveSheet.Name = Right(c.Value, 30) Next c End Sub
By the way, I don't know what the ActiveSheet.Name = Right(c.Value, 30) line does, but I put it in since it was in the code I was modifying.
I'm creating a summary sheet that adds up all the data on sheets between start and finish where A2-A25 is SU and B2-B25 is 004*04. Background info: SU stands for SetUp, and 004*04 is a workcenter number (its not 004 times 04) I'm trying to calculate the total number of Setups for each workcenter.
I am currently using the array formula to find out the most recent date a business as referred a deal. I have been using the below array formula to figure this out...
However, we have now have two types of deals. Opps and Suspects. SO now i need to figure out the most recent date from Opps!G:G and Suspects!G:G... regardless of what the deal type is. Hope that makes sense.
Basically i need to have a formula along the same lines as above but MAX date from if conditions from Opps OR conditions from Suspects
Looking to code a loop to go to sheets whose names begin with "day" and a number and clear a specific range. How would i code this without affecting the other sheets in the book?
I am looking for some code to scan my sheet names and delete all the sheets that don't have names corresponding to the values within a cell range contained on another sheet in the workbook. For example, if any sheet name, excluding a few reserved sheets, doesn't equal one of the values contained in cells A2:A23 on sheet "XYZ" then delete it.
The best solution I could come up with using my experience was to loop through each sheet and compare the name to each cell in the named range, but if it's possible to somehow declare the named range so that each sheet only has to compare to it that would be ideal;
In a school gradebook, there are 7 sheets for grading. In each sheet, student names and other info are in cols B through E, and headings are on rows 11 & 12. Grades are in cols Z11:AB..., AC11:AE..., and AO11:AQ..., where ... would be the last row of grades associated with a student.
My obstacle is that the grading cols contain formulas down to row 80, so Range(Selection, Selection.End(xlDown)).Select goes down to row 80 instead of stopping on the row of the last student's name on that sheet.
Another obstacle is that student records are on every other row (odd rows) starting on row 13. Their grades are in the same row.
I have an excel file, with roughly 1000 rows and about 6 columns per sheet of data, and about 10 sheets. I need to find combinations of numbers (in a single row) that match exactly with any of the other sheets.
For example, if Sheet 1 row 345 has the values (5,8,10,100,35,49), I want to find any other rows in any other sheets (including the sheet with row 345 values) that match exactly (5,8,10,100,35,49) and somehow identify a matching pair (possibly highlighting the cells).
I want to search every row in every sheet with all the rows/sheets in the excel file.
We could also probably add up all the values in a row into a 7th column, and find any of those #'s that match throughout the project (only in the 7th column), and I can go through and manually look for combinations myself.
I'm trying to retrieve the worksheet names to a specif cell and populate from that point only with the names of the visible sheets, but It keeps returning only the last visible sheet name and not the sheets that are visible. Where the code is failing - I'm self learner and start with VBA macros a couple of months so I'm still learning how to identify when the error show up
Code: Sub Summary() Dim wks As Worksheet ultl = Sheets("Control").Cells(1048576, 4).End(xlUp).Row For i = 31 To ultl
I've got a spreadsheet with a 'data' sheet and I want to add and name additional sheets based on the contents of a range in the 'data' sheet - it could be 1 extra sheet, it could be 100, the range is open ended.
I have the following data in one "Project_list" tab:
Project AAAA BBBB CCCC DDDD
I want to copy this data into another tab "Transpose" in this form:
AAAA AAAA AAAA AAAA BBBB BBBB BBBB BBBB
[code].....
So basically copying 4 times every row... as simple as that The constraint: I have about 1500+ projects in the project list, but this list can change so i need a statement that copy values 4 times till source tab has empty values. I would like to have in the second column the following serie for each project.
AAAA Q12014 AAAA Q22014 AAAA Q32014 AAAA Q42014
Note- i want to do this in VB not though formulas as i am doing other derivations in macro.
I have been searching the web and wracking my brain trying to do this and now I am here (for one place to start) for help. Especially since I got the formula below from this forum.
1. I have a worksheet with multiple sheets. All the sheets except the last are labeled by department. The last sheet is labeled Totals. All the department sheets follow a template that I don't want to change so any totals or formulas I want to add, I want to do off of the Totals sheet.
2. For an example, I want to total all PCs with the model "Compaq 1.8" from all the sheets onto the Totals sheet. It doesn't seem like Countif can do multiple (or 3d) sheets. It can only do one sheet.
It looks like the only way to do this is to use a UDF (User Defined Function) or some other Function to do this.
I found a UDF that looks like it should work (see below). However, I have tried this function but all I get is the #NAME? error/message. I have tried multiple ways to simplify this function just to test that I can get any data from it but keep coming up with the #NAME? error.
Public Function CntIf3D(rng As Range, V As Variant, ParamArray arglist() As Variant) Application.Volatile CntIf3D = 0 For Each arg In arglist CntIf3D = WorksheetFunction.CountIf(Sheets(arg).Range(rng.Address), V) + CntIf3D Rem Next End Function If I could get the above code to work, It would be nice but I would have to add another department into every total for each new piece of equipment. Some code that would just use the sheet indexes would be nicer, that way any new department inserted before the TOTALS sheet would be automatically added in. Since I can't even get the above code to work, however, I don't want to waste my time trying to test code that would use the indexes.
Currently I’m using several formulas to acquire my result; I know it can be abbreviated to a more compact formula.
I have four Sheets. One summary sheet and SheetA, SheetB and SheetC containing Data. All sheets are documented in an equal format, e.g.: in column A: Date, column B: Code (A, B, C or D) and Column C: values.
Criteria are located in the summary sheet e.g.: A2: 1-1-2008 A3: 2-1-2008 and B2: A, B3:B The data sheets are listed in H1:H3.
The results should cover a sum of col C over the sheets by using the critiria listed in summary sheet.
The criteria range is variable; sometimes I only want to use one criteria and sometimes more.
copy range of data from "sheet1" to sheets named A-Z i.e A,B,C,D,E..... in the same location as it was on sheet1 e.g. if on sheet1 data was in B1:C10. i want to copy this onto the sheets named from A to Z in the lacation.
Is it possible to form a single Range object from ranges on multiple sheets. So for example, would it be possible to set a Range object equal to cells A1:D146 from Sheet 1 and A1:B49 from Sheet 2 and if so, what would be the syntax? For the first I have: Sheets("SelectData").Range("A1:D146").SpecialCells(xlCellTypeVisible) but I wouldn't know how to proceed from there.
I found this very nice code on this site that changes the names of my sheets based on the first sheet, works great. What I want though is to have the sheets be unhidden when their name changes from the generic name "sheet1" to whatever else we call it. Can this code be manipulated to do that? I want the sheets whose names do not change to stay hidden, the others to unhide.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lCount As Long
If Target.Cells.Count > 1 Then Exit Sub
On Error Resume Next If Not Intersect(Target, Range("A2:A11")) Is Nothing Then For lCount = 2 To 11 If Sheets(lCount).Name <> Me.Name Then Sheets(lCount).Name = Me.Cells(lCount, "A") End If Next lCount End If
Using InputBox Method to Select Range from Other Sheets
I need to select a range of cells from a second workbook via a InputBox or similar.
I'm trying to do that with the following
Sub InputBoxTest() Dim MySelection As Range Set MySelection = Application.InputBox(prompt:="Select a range of cells", Type:=8) MySelection.Select End Sub
But I can't select a cell range if it is located in other workbook.
I have several workbooks, and the workbooks can include several sheets. Is there's an easy way to create a macro so the user selection to be hidden or unhidden is hidden or unhidden in all sheets in the workbook. E.g. if the user selection is to hide rows 54-189, the macro hides rows 54-189 in all sheets in the workbook.