I would like to know whether its possible to fix a sheet to always be the second sheet in a work book no matter how many other sheets are added. Currently I have set up macros to add subsequent sheets before the last sheet, so that Sheets("Number 2") remain sheets(2). Is there some way I can lock the first two sheets so that when I reference them in my code as sheets(1) and sheets(2) it will reference the right sheets. Right now I have it set up so that Sheets("Number 2") can be renamed by the user, and data inputted on this sheet, but I require that the user not be able to move this sheet and the sheet preceding it.
Is it possible to loop through a list of sheets and execute some calculations that have sheet references from a different list of worksheets? For example, you have a list (list 1) of your worksheets, which will be the destinations of the calculations, and you have a second list (list 2) of worksheets that the calculations are based on. So, lets say there are sheet1 and sheet2 in list 1, and sheetA and sheetB in list 2. The calculations based on sheetA would appear in sheet1, and calculations based on sheetB would appear in sheet2. I thought the code would look something like this:
Code: Sub LoopthroughWorksheets() Dim sheet_name As Range Dim sheet_name2 As Range Set sheet_name2 = Sheets("WS").Range("F:F")
I'm getting a "Run-time error '1004: Application-defined or object defined error" at this line:
I have data which is exported from my system which includes the job date and gross profit amount. I want to find the gross profit total for each day based on a matching date. However, the data exported includes the time in the date cell and Google Sheets won't match it. I'd like to avoid using a helper cell if at all possible.
I have sets of data (A1....F50000 or more) that I need to sort out based on the cell value in column F. Based on the cell value I would like the info on the row (A to F) put into a different sheet. There would be 8 different sheets and each sheet would include 1 to 50 different sorts from column F.
The macro could start with one material sort each and I could fill in the rest of the sorts. The 8 different materials (one for each sheet to start) could be "34b2p""ptop27""pdw19""p58leg""ppdpts""mirror""Pdoor""bent""p4545".
I have merged 336 individual spreadsheets into one book, now I want to merge the data in all the sheets into 1 individual sheet. All the sheets have the same size and range, I need to copy a constant range(row,column) from all the different sheets into one.
I have a workbook with 26 sheets, labelled A to Z. Column A in all the sheets have names from rows A6:A35.
I need a macro or a code to extract all the names from each of the 26 sheets and paste it to a new sheet 'Names' under column A, such that names starting with 'B' paste under all the names 'A' and so forth till 'Z'.
I've inherited a workbook with 100 or so tabs. There are absolute references to cells on the summary page scattered about all over the place. Hundreds of them, all over everywhere, with no easy way to find them.
Now they want to be able to add/delete rows on the summary page and sort.
I want to replace their absolutes with named ranges. Is there an easy way to find every cell that references the summary sheet?
I have not used Excel since the 80's (when I knew everything about it), but obviously that was many versions back... I jumped into using VBA, and that's starting to make sense, but I'm still missing some of basics.
I have created some code that copies a master workbook into a new workbook that then creates new tabs for the sheets relevant to week numbers. In the master workbook there are 8 sheets, most of which reference each other in their formulas at some point. The problem arises in the newly created workbook as the sheettab names are renamed e.g "manager" in the master will become "manager wk1", "manager wk2" and so on. All the sheets are copying over great but they the lose their references to each of the sheets within their week groups because the formulas do not change to the correct week references. I am trying to solve the problem by using the Indirect funtion to change the formulas in the master to reference the correct week number, but i feel this is not the best way?
I would like to use VBA to search a folder and copy data from tabs within the excel files there. The data will be pasted to a tab of same name in the the main file. All the files are in the same format.
So far I have only managed to list the files in the folder using code I found on your site!
I have a workbook that updates from external source and creates sheets depending on a cell range.
I have put tab 1 and tab 0 on either end of where the new sheets will be inputted, will never know how many sheets
What i need to happen is if someone fills in "complete" in A7 in my "summary" sheet then the values in row 6 in all the other sheets get hardcoded. This needs to happen from A7 down to A26, so A8 = complete then copy row 7 etc This is what i have so far
I get compile error here ........Sheets(ArrSh(1)).Activate
Also need it to work for all the other rows.
Sub hardcode() ' 'Sheets("Summary"). Select If Range("a7") = "complete" Then ' Sheets(Array("1", "0")).Select Sheets(ArrSh(1)).Activate
I am writing a VBA macro in excel. I have several sheets in this one workbook........one sheet for each day in a given month. Sheets for each day are labled as 3_1, 3_2 for march 1st and march 2nd respectively. I also have 4 sheets for the 4 weeks in a given month. The weekly sheets are labeled week1, week2 etc....
What i am trying to do is this:
In the week1 sheet i am trying to "put" a formula in say cell 9,12 which sums up the same cell in the first 7 days of the month. But i am having issues. Does anyone have a good way to do this via VBA?
on sheet1 I have a button I need to do the following when clicked: (1) name the next 30 sheets based on cell values in sheet1 (2) for those 30 sheets, hide some of them based on a y/n input in sheet 1
To clarify: the worksheets do not need to be created, they already exist. They just need to be renamed and hidden based on that y/n criteria. see attachment with just 1 worksheet for clarification. So - The next 30 sheets are to be named by the following ranges (B7:B16), (B21:B30) and (B35:B44). For every product with a "n" in column C of sheet1, the worksheet for that product needs to be hidden.
I need to sort my sheets by name, A-Z but as the worksheet names are things like Door 1, Door D67, Door 100 etc, I don't think I can use a simple code like the below, Because i'd end up with Door 1, Door 100, Door 101, Door 2, Door 200......
Sub Sort_Active_Book() Application.ScreenUpdating = False Dim i As Integer Dim j As Integer
I have this code, which sorts a list of data in cell C17 down to CXXX (the list will keep growing as I add more doors) It works by pasting a formula stored in F17, in Col D, next to my list of doors, and picks out the numbers so that I can sort.
Sub ListSorter() Dim LastRow As Long LastRow = Range("C" & Rows.Count).End(xlUp).row Range("F17").Copy Range("D17") Application.CutCopyMode = False
Perhaps I could add some code to the bottom of this, that will sort my worksheet names as per the order of my list in col C?
On Sheet1 I have a list of 32 people in column A (A1:A32) and on the same sheet in column B (B1:B32) is a 3 digit number representing a score. I have the 2 columns sorted together descending order based on column B scores.
On Sheet 2 in column A (A1:A32) I have the same 32 names in random order with associated information in columns B to K. I want to sort the names and associated information on Sheet 2 column A based on the order of the same names in Sheet 1 column A. Is there a formula to achieve this result?
Need to move data from 14 sheets (1 pay period=14 days)(2 showing on attachment for example purposes) to time cards for each person (number of employees will vary).
Key data to move to the time card is the date of the hours, #Reg Hours, #OT hours, the ticket# and job# for those hours.(ie Chris Adams Aug 15, need Chris's Reg and OT hours (8 Reg and 2 OT) on his time sheet, and the corresponding ticket number and job number (in this case from I1, I2).
Unknown number of ticket/job numbers, but the pattern of cell entries will remain the same along the top of the date sheets.(starting at I1, then L1, O1, the next would be R1)
Unknown number of employees but they will continue filling down where the names are on the date sheets (column A). Each employee would have a time card sheet as well.
I am trying to get data from one sheet to another. For example:
You'll notice on my attached workbook I have serveral sheets that I would like to show on the one sheet labeled Rollup. Now i know all i have to do is copy and paste, but I would rather for the data to automatically update on the Rollup sheet.
i had different sheets containing the same type of data in every sheet.what i want is to merge all data into one sheet.i had attached the sample sheet for reference.also let me know how to know the last cell in the data sheet
I have excel file, consists of 4 sheets Data, PF, Gratuity, Discrepancy. Here I have Emp no. field as key field, now here first I have to check Data Sheet data with PF.
Suppose, we are considering Emp no.: 4 from data sheet. It will check in PF sheet for same Emp no. if it find then it will check the relationship and first name and last name from data sheet. If it is ok then it will return output in discrepancy sheet with OK. Discrepancy sheet format:
Emp No. Spouse Child1 Child2 Father (All the relationship present in Data Sheet in Column)
I am trying to get specific data from several worksheets and put it into a master list. My biggest problem is the the primary sheets are constantly updated and would need to extract some data fromt the master list for these updates.
What I have now is working fine, but I have to duplicate some of the data whenever I add a new sheet.
Can this be done using formulas or do I have to learn some VBA or use of macros?
I have Sheet1 with point numbers in column A; X, Y, and Z coordinates in columns B, C, and D. Other sheets are the same format for different jobs! I would like to be able to have all points in the master list and accessable from all sheets when the jobs overlap and same data is requested.
I have a "main data"Test.xlsx sheet wherein I have to populate 4 columns from 2 other sheets.
E.g.: In master data tab, I have (PID,EMP ID,Name,Address,Join Date, Exit Date). Now i am trying to get the PID & Address from another tab called "PID,Address". To get the PID & address, i will use EMP ID as reference to fetch data.
Similarly, I have to pull Join & Exit dates from the tab "Dates Sheet" with same EMP ID.
I have a home tab, wherein I have a button which is assigned a macro to reconcile the data.
I know that I can do this with simple vlookup for all the columns, but the actual data is very huge and it may vary daily. So its time consuming process. So i want to this reconciliation (consolidation) using macro. How to generate a macro.
What I'm trying to do is find a way to extract from those two sheets the date, serial number, page count, and ticket number where the date / serial # are the same and dump this to a new sheet. I've thought that I may need to concatenate the date / serial number together into a single cell or something, but I'm really at a loss as to how to pull this data. Part of me thinks this should be done in SQL, not a spreadsheet, but that's how our reports are produced.