Export ALL modules, forms, objects etc in one workbook to another and if that can't be done than at least all modules and/or objects. This is so I can change code but leave the formulas/values etc in the main excel sheets. Basically it would need to delete all VBA code and copy, I guess from a text file to insert the new code, at least for modules and objects. Forms, I don't know how that can be done?
I want to enter a name in a cell from a list of 70 names I have on another work sheet. By just typing the first few letters of the name into the cell I need it to complete the entry. I do not want to use a drop down box it takes too long to find the name. I need a formula to do this for my spread sheet.
I am trying to implement this formula in my file: = SUMPRODUCT(SUMIF(INDIRECT("'"&$H$1:$H$20&"'!A1:A100"),"criteria1",INDIRECT("'"&$H$1:$H$20&"'!B1:B100"))). I have over 35 sheets in this file with different names. Is there a way to export all the sheet names in list format so that I don't have to go back and forth in the file and type the names?
I just started playing with creating my own macros. I've written a macro to pull all the names of the worksheets in a workbook, now what I want to do is write a piece of code that will pull data from a cell in those worksheets.
So for instance I have all my worksheet names in cell A1 to A10, I want to pull the data from cell E1 from every worksheet in A1 to A10. Can someone help me with a sample code to work with. I'm still reading Power Progamming haven't gotten so far yet.
I want to create a simple worksheet that takes a list of names (All of the members of my family) and Randomly selects another name from that same list and matches them to it ( I don't want to say "paired" because I want each person to have a one way relationship to the other, in other words just because personA is matched to personB, i don't want personB to automatically be paired to personA) I hope that makes sense. Once every name on the list is matched with a person I would like to move that name to a database that I can track each year. The practical application of it is this: Each year our family randomly draws names and we are tasked to buy a new x-mas ornimate for that person, ideally you would not get the same person 2 years in a row, and the person that you have does not have you in return simply to add more variety and the database would track who had who each year.
Code: Sub test() Dim a, i As Long, temp, n As Long a = Range("b2", Range("b" & Rows.Count).End(xlUp)) Randomize With CreateObject("System.Collections.SortedList") For i = 1 To UBound(a, 1)
I have a set of worksheets (Sheet31 through Sheet49 by codename) produced by a machine in the lab. I want to create a summary sheet that references cells in those worksheets.
Rather than go through the annoyance of doing this manually 40+ times I'm working on creating a macro to populate the summary sheet for me.
This is what I have so far
For J = 31 To 49 ResultSht = SheetJ.Name Sheet1.Activate ActiveSheet.Range("A4").End(xlDown).Offset(1, 0).Select
It hangs up on the "SheetJ.Name" however. My objective is to be using the object SheetJ, where the object SheetJ is the codename of the results sheet I'm trying to reference (for example, in the first pass through the loop it would be Sheet31). Could someone point out my mistake in this object reference?
I need a macro that will look for a list of sheet names - like Albany, Houston, Denver - and return the value of a particular cell - like B25 from each sheet and display it in a column of cells on a summary sheet.
when i open a xls, i would like to Display the Vertical Menu Of Worksheets (at the bottom left of the tab names)
--this worksheet has many sheets and i find this an easy way to navigate...
(also, how can i write a macro--for a user shortcut--to display this--currently, i hover my mouse pointer over the bottom left tab navigation object and right click to bring up the vertical display of sheet names...)
I have created a file that has several worksheets with different naming convention - to specify what the sheets are for. However, as the sheets are added, I sometimes find it difficult to keep track of all the sheets that I have in the workbook.
Is there a Macro Code or formula that I can use so that a Summary worksheet can summarize all the names of the worksheets that I have in the particular workbook.
I have a workbook with 20+ sheets in it, I add sheets and delete sheets on a daily basis, except for one sheet that is like my summary sheet.
Is there a code, formula, or magic spell that will list the names of the sheets that I have deleted? For instance, if my workbook has 50 sheets and I delete 49 of them, I want to see cells A1 thru A49 (or where ever I wish to place them) filled with the names of the sheets I just deleted.
I believe I have 99% of what I need. The code below has one bug. (See just the underlined text for a very quick overview. The rest is detail.)
My goal is to generate a TOC that: 1) has the VBA run from my Personal Workbook. 2) can be run in any worksheet of any open workbook. 3) can be run in a worksheet of any name. 4) will insert itself at the currently active cell. 5) has entries hyperlinking to the referenced worksheets - of any name.
Right now, I'm stuck with the last point. The macro below will generate the TOC at the currently active cell. The TOC will be hyperlinks to the referenced worksheets.
However, if the referenced worksheet contains a space, dash, or other special character then the generated hyperlink is broken. For example, if the referenced worksheet is "sheet1" then the hyperlink generated works just fine. However, if the referenced worksheet is "sheet-1" then the generated hyperlink doesn't work.
Sub IndexList() Dim objSheet As Object Dim intRow As Integer Dim strCol As Integer
Set objSheet = Excel.Sheets intRow = ActiveCell.Row 'Start writing in active row strCol = ActiveCell.Column 'Start writing in active column
For Each objSheet In ActiveWorkbook.Sheets Cells(intRow, strCol).Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _ objSheet.Name & "!A1", TextToDisplay:=objSheet.Name intRow = intRow + 1 Next End Sub
I have created 70 "templates" in my workbook. I would like to change the name of each template to the name contained on a list in the "Data" sheet. The list starts at a4, and may have 70 or more names. I want to cycle through each name, place it in cell c8 of the template, rename the template with the same name, then move on to the next name, rename the next template, place name in cell c8, and so forth. So far I have this, which creates the "template" and renames it according to the list, but it doesn't insert the name into cell C8 of each new sheet.
Sub NewSheets() Dim I As Integer Dim ws As Worksheet Dim sh As Worksheet Set ws = Sheets("Template")
Within one workbook I have 15 sheets, 13 are for separate divisions within the company, 2 are used to present sums across the 13 sheets. All 13 sheets have identical columns and rows, with unique numbers in each cell. Right now I am manually selecting the cells to reference in my master sheet, =sheet name!cell+sheetname!cell+sheetname!cell - so and and so on. How can I reference the sheet name once, and then all of the cells to SUM? =sheetname!(c4+c14+c24+c34) etc?
This would let me be able to copy the formula from cell to cell, and only have to change the sheet name each time.
I would like to be able to display all of the sheets in a workbook as a list on the front sheet.
I have a front "Contents" Sheet (attached at the bottom of my post)
In the "Ticket No." column I wanted to have the sheet name, in the "Date" and "Description" column I wanted to display cell values from each sheet; which would be the date and description of that sheet/"Ticket". The "Resolved?" column I will be able to do after I have this part figured out.
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
I'm trying to find a way to save a single sheet of an excel workbook and in the same process delete all vba code and shapes from the new single sheet workbook. I was looking around and found this code which does save only the single sheet to a new one sheet workbook but doesn't delete the vba and shape that I have used to assign macros to in the original.
Code: Sub SaveSheetAsNewBook() Dim wb As Workbook Dim InitFileName As String Dim fileSaveName As String Dim wshape As Shape InitFileName = ThisWorkbook.Path & Format(Date, "mm.dd.yy")
I have this script (below, Krishnakumar orignally provided this script).
I'm trying to edit it to add cell values from cells C16 and E16 along with the worksheet name it displays in listbox2. So lets say worksheet "rollover" is the sheet being displayed in the listbox2.
I would like for it to look something like this:
rollover TT:'data from cell C16' TA:'data from cell E16'
Public FilePath As String Public dic As Object Public oWB As String Public oWS As String Public aWS As Worksheet
Private Sub CommandButton1_Click() Dim i As Long, wb As Workbook, n As Long With Me.ListBox2 For i = 0 To .ListCount - 1 If .Selected(i) = True Then oWS = .list(i) Set wb = Workbooks.Open(FilePath & oWB, UpdateLinks:=0) wb.Sheets(oWS).Activate Exit For End If Next End With End Sub
I have a database output file where one of the columns contains managers names, often more than once. I want to apply an autofilter on manager name and then copy the result to another sheet or sheets. My criteria for the autofilter is a variable pointing to a list of names that at present I maintain by hand; a for-each-next loop then cycles through the names.
What I would like to do, before running the autofilter code, is to create the list of names via code. This would then automatically pickup names that are missing.
The code I have so far is below:
Public Sub find_managers() Dim managers1 As Range Dim names1 As Range Dim n1 As Variant Dim n2 As Variant
In my mind it should check the names in the unique list against the imported list and add any missing names.
I have a vba process that develops statistics/graphical output via SQL queries of pretty large datasets. This usually takes about 2min, so I run it via a form I've build, and then go do other work or play on the net, checking and rechecking if it has completed. I do have a msgbox once the process is complete, but if i am not actively in an Excel window, I will not see it. Is there a way to force the windows taskbar to flash or something so i can see that my process is complete if i am not in an Excel window?