1) I'm relatively new to arrays, but what I need to do is generate a list of file names and the sheets within each one. I would like to use an array for this, but since I don't have much experience.... well....that's why I'm here. Can someone point me in the right direction?
2) And the second part of this.... I was planning on using the FileSystemObject to determine the files in a selected folder and loop through that list of files, opening each one and harvesting the required info (file name and all sheet names). Should I use the FSO or is there something built into Excel that might be better (and also limit the number of dependencies for this little "project" of mine).
I have this logic that clears cells in all WS in WB.
The logic is using each sheet name to reference the logic to clear the contents. Look:
Private Sub CommandButton1_Click() ActiveSheet.Unprotect Password:="" With Application .ScreenUpdating = False .EnableEvents = False Response = MsgBox("This Action Will Prep For A New Week. Do you want to Continue?", vbYesNo) If Response = vbNo Then Exit Sub End If
I have a userform with 10 rows of data with 8 colums in each row... I am trying to figure out how to dynamically address the object names (ie Textboxes).
Short and simply let's say I have 10 Text boxes named textbox1, textbox2, textbox3, etc
I want to address them in a loop as follows
Private Sub Clear_Fields() Dim field As Object For x = 1 To 10 field = "textbox" & LTrim(Str(x)) field.Value = "1" Next x End Sub Obviously I'm missing something here as I get the error Object Variable or With Block Variable not set
I need the 'Week 26' and the 'John Smith' to be changeable and preferabilly linked to a cell using the INDIRECT formula so I can change all references to Week 26, 27, 28 etc and also change the workbook name it is referencing.
I have attempted to do this in the following way
I broke down the pathname to seperate cells
Cell 1: 'C:Spreadsheets Cell 2: A reference linking to a cell containing value: Week 26 Cell 3: A reference linking to a cell containing value: [John Smith.xls] Cell 4: Sheet1'!$A$1
I then used the CONCATENATE formula to link these into a single cell as a text string.
I then tried to use INDIRECT to link to the filemane in the CONCATENATE cell.
This did not work.
I need a way to make parts of the filename variable and linked to one cell.
I also need to do this while the other workbooks are closed.
I have found some information on INDIRECT.EXT which as far as I can make out involves installing mods to Excel to make these work, I cannot do this as the spreadsheet will be used across our network and will eventually be used by thousands of users.
I have an excel workbook with a dynamic dependent drop down list setup, works a treat on the first worksheet i set it up on.
However here's the problem, my workbook contains a good handful of worksheets each named to reflect the certificate on the page, i need the drop down list to work on each tab. problem is when i setup the index/match function it requires a specific sheet name to make it work i.e.
I have a column of data that is blank-delimited into five blocks. The size of each block will vary, since the data comes from a web query. A blank (empty) cell tells me where a block ends and the next one begins.
I would like to set up five dynamic names (e.g. Block_1, Block_2 and so on), each of which will reference the corresponding segment of data.
What would be an elegant way of defining the dynamic names?
I have workbook that has several sheets within the workbook that are set up identical. Each of the sheets in the workbook are for a specific company.
As of right now I have been adding a sheet to the workbook that is an overview for what is in each sheet (the individual companies). Currently I am doing the formatting of the heading and column names manually and I pull the data from each sheet with a VLookup. I have been trying to enhance my VBA skills with coding something that will fill in the appropriate cells from worksheet to worksheet.
What I am trying to do is to populate an overview sheet with cells C24, C25, and B36 being static on each row per sheet. Then each row will be populated with cells C(36, 59, 70, 81), D(36, 59, 70, 81), F(36, 59, 70, 81), G, and H(36, 59, 70, 81). The overview sheet will have the diagram below in a ru
I have a separate sheet that I will drop a csv file into. On another sheet, I would like to copy that data. I know how to copy a cell and drag it to collect all the cells for the first go around, and this would work great if only my csv file had the same amount of rows each time, which it doesn't.
Is there anyway to create a macro to copy a dynamic range of rows from another sheet?
I have an excel sheet which at the moment takes it name from a cell on that sheet, but what I would like to reverse if possible. How can I get the sheet to name itself from a cell. I'm sure I've been on a web page in the past with this info on it, does anyone have the link?
I’ve had a look through the forum and on some of the guides/FAQ but thanks to my ineptitude I have been unable to adapt any of the examples to my specific situation.
What I’m after is this: I need to create a summary sheet for a work book with a variable number of tabs. All I need the summary sheet to do is to make a table of the name of the tab and then cell A17. How would I go about doing this and is it possible to save this macro to my machine/all workbooks instead of just the one?
In Column A row 4 of sheet1 I have an account name, for example Sonic, and I have a sheet named the account name, Sonic. In Column B row 4, of sheet1, I would like to return the value in Column B row 3 in sheet named Sonic, or the account named sheet.
I have about 50 different account names along Column A in sheet1, and the same account name sheets opened in the same workbook. Is there a good formula or vba code that will work for all the values in Column A of sheet1 to look for the same named sheet and return the values off of that? Note: on the account sheets in Column A it says ‘Account’ for all of them.. this wasn’t a mistype
I wrote the following macro to create hyperlinked Table of contents on the first sheet of a workbook. It works great unless the sheet name has a space in it, i.e. "new sheet" as opposed to "newsheet". Any way to get it to work for either/ or?
Originally Posted by Code
Sub Hyperlink() ' ' Hyperlink Macro ' Macro recorded 2/26/2007 by bpillsbu '
' Dim ShName As String Dim ShCt, N As Integer Dim Sht As Worksheet
ShCt = ThisWorkbook.Worksheets.Count Range("A5").Select N = 1
I have searched the forum and I have seem quite a few referrences to this question but can't find exactly what I'm looking for. I'm using the first sheet in the worksbook as a splash screen which has lots of button macros on there. I want to add one more which will make a list on this sheet from cell b25 down with all the sheet names in the workbook which are also clickable hyperlinks. Does anyone have any idea how to do this, so far I can make a list of the names..
Sub Index() Dim ws As Worksheet Dim I As Long
I = 25 For Each ws In Worksheets If ws.Name "Actions" And ws.Name "summary" And ws.Name "Archive" Then Worksheets("Summary").Range("B" & I) = ws.Name I = I + 1 End If Next ws
But have no idea how to make these names clickable which will make the relevant sheet active. If it helps the sheet name is also in cell A2 of every sheet.
I have done a formula for Abbott as shown below however I actually have about 50 sheets with names. I have the names listed in column A. Is there a formula that instead of typing Abbott as shown I can use the cell in column A to generate a code ?
The Board looks full of some interesting issues today.
I'm working on a workbook that hides and unhides a lot of columns depending on the month the user has selected. No problems here.
The sheets are named regionally, ie National 2008, California 2008 etc. The user is able to select the month and the year from separate combo boxes.
So when 2009 comes around I will need to rewrite many lines of code to point the VBA to the new worksheet names like National 2009, California 2009. My question is, is there a way to reference either variable worksheet names in the VBA or some other manner in which to write the code so I don't need to rewrite every year change?
I currently reference the sheets something like Sheets ("National 2008").Range("H:H").EntireColumn.Hidden=True
I have a spreadsheet with sheet numbers that are controlled by the tab name. Is it possible to limit how people name the tab? For example, my sheet numbering must be: 101, 102, etc. Thus the tab would of course be 101, 102, etc.
I have been using the code below for a form. But now I need to change the sheet name to have spaces. But when I do. I comes up with the Run Time 1004 error on the “Ctrl.Text = Range(Ctrl.Tag).Text '*** “ line.
Why is it that this line is not allowing me to have spaces?
Private Sub Load_Controls() Dim Ctrl As Control For Each Ctrl In UserForm1.Controls If Ctrl.Tag "" Then Ctrl.Text = Range(Ctrl.Tag).Text '*** End If Next Ctrl End Sub
I want to add to it so that if the "Name" entered into the target cell is longer then the maximum allowd length it inserts an abreviation of the words (and increments where nessisary)
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) On Error GoTo StandardName If Target.Address = "$B$4" Then Sh.Name = Target Exit Sub StandardName: Sh.Name = "Sheet1" End Sub