macros and vba
6540 TopicsHow do I save an Excel Add-in (XLAM) file?
We had a new(er) version of Excel shoved on us and the result it it doens't do this, so we're sort of in a bad place. How do I save the add-in? We were probably on an old-ish version because it was stable and upgrades tend to break us - as they have here. I'm wondering how I save an add-in now. Right now our workflow is completely broken. When I go to File--> Save there is no xlam file type available now. I can still load an old xlam but I can't create a new one.Solved54Views0likes4CommentsExcel VBA – Target a specific named table when multiple ListObjects exist on each worksheet
My workbook has 12 sheets each having the name of a month. Each sheet contains a table named LotSize?? where ?? = number of the respective month as given below. Sheet name-Table name: January-LotSize01, February-LotSize02,...., December-LotSize12. Each of these tables have two columns named SCRIP and LotSize. I want a simple VBA code for following: 1] Clear the content of LotSize column of each such table from all 12 sheets. 2] Add text A, B, C, D, E in the cells of column SCRIP of each such table in all 12 sheets. I will later replace A, B, C, ...etc. with the actual scrip names as per requirement. Sub UpdateTables() Dim monthNames As Variant: monthNames = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") Dim vals As Variant: vals = Array("A", "B", "C", "D", "E") Dim ws As Worksheet Dim tbl As ListObject Dim lr As ListRow Dim i As Long Dim j As Integer For i = LBound(monthNames) To UBound(monthNames) Set ws = ThisWorkbook.Worksheets(monthNames(i)) If Not ws Is Nothing Then If ws.ListObjects.Count > 0 Then Set tbl = ws.ListObjects(1) With tbl If Not .DataBodyRange Is Nothing Then .DataBodyRange.Delete For j = 1 To 5 Set lr = .ListRows.Add lr.Range(tbl.ListColumns("SCRIP").Index) = vals(j - 1) Next j End With End If End If Set ws = Nothing Set tbl = Nothing Set lr = Nothing Next i End Sub Above code works only if each sheet has only one such table but I am having three different tables on each sheet with LotSize?? (?? = Month number) being one of them. How can we modify given code to incorporate this change so that the code operates on the desired table to achieve the stated objectives?Solved76Views0likes5CommentsHide rows based on Drop-down box selection
Hello, I have a drop-down box with different selections. One of which is "VPN to VPN Cloud-Based". If this is selected then I want to hide rows 36 through 239. Doing something wrong in my code, as it isn't doing anything when "VPN to VPN Cloud-Based" is select. Any ideas what I need to change? Attaching screenshot of the form and the VBA. Thanks.24Views0likes1CommentI need help with userform create list of teams no repeated
I have a userform for the NFL playoffs. 14 combo boxes for wild card & Divisional only. I want to create a search with no repeat, and after I pick team, should not the list should not be repeated. Dark red is for AFC TEAMS and dark blue is for NFC TEAMS. I have listed teams on the teams info worksheet. I need help getting this working20Views0likes0CommentsCannot delete a macro
Windows 10 desktop computer, Excel I recorded a macro, seems to have an error. Want to Delete it and try again. When I go into Macros, I see it listed and highlighted (it is the only one), try to click Delete, but get message : "Cannot edit a macro on a hidden workbook. Unhide the workbook using the Unhide command" Don't know what this means. I don't know of any hidden workbooks, never did anything to hide any workbook. Help for "unhide" says go to Home-->(Cells) Format-->Visibility-->Hide&Unhide, but when I go there, the entry for Unhide Sheet is grayed out. so cannot do that anyway. I just want to delete the macro I recorded before and try to record it again to get rid of whatever error it contains. This is a macro I intended to use in any Excel workbook and is listed as PERSONAL.XLSB!(name) and below the list of Macro names there is a box Macros in: All Open Workbooks It is the only macro listed, there are no others.5.6KViews0likes12CommentsChange in return of AVERAGE function - Mac Excel
I was puzzled that a spreadsheet I use daily generated an error today that had not existed in earlier versions. Attempts to confirm the validity of the spreadsheet functions by running prior versions that had previously run error free resulted in the same error. Eventually, it seems that the operation of the AVERAGE function has been changed in an Excel program update that was installed yesterday. Previously, if an AVERAGE function addressed a range of empty cells, it would return a zero value. Now it is returning the error #DIV/0! This is strange because the AVERAGE function will now return zero if the addressed range contains zeros rather than just being empty. Not sure if Microsoft intended this change or if the change might also apply to other functions. In muy case, I'm able to change my spreadsheet to provide for this but it would have been nice to have some warning.Solved157Views0likes3CommentsCannot add a worksheet to my Excel spreadsheet
I haver all of a sudden lost the ability to add worksheets to my spreadsheet program. I am using macros that both protect and unprotect the sheets that are currently there, but I want to add another sheet, and the plus sign at the bottom is grayed out as well as the 'Insert Line' line when you do Home/Insert. I have looked and I cannot find the setting that controls the addition of worksheets. Any suggestions???70Views0likes6CommentsmsoFileDialogFolderPicker compiler error
I have searched the net and not seen this issue. I developed a stand alone program in Excel Vba using msoFileDialogFolderPicker. It runs no problem. The function is as follows: Function PickFolder() As String With Application.FileDialog(msoFileDialogFolderPicker) If .Show = -1 Then PickFolder = .SelectedItems(1) End With End Function This was then added to a larger program with exactly the same code on the same PC and I get 'compile error' variable not found with 'msoFileDialogFolderPicker' highlighted.70Views0likes1CommentVariable "Connecting to Datasource" Load times
Hello, I am running into a strange issue that I am not sure how to solve. I am using Power Query to link to external Excel data files/Sheets and then I process the data within Power Query and also have some Macros that run after the data is refreshed. I am seeing a drastic difference in the amount of time it takes separate users to open/refresh this file (the users have the same internet connection, use the same link to the file on a Shared Drive on our servers, same Excel settings, and have the same hardware). Some users can load and run all Macros in < 15 seconds, while the others take > 10 minutes. I have exhausted all possible causes/reasons that I can think of and am looking for some guidance. Any and all suggestions are appreciated! Thanks, Skywalker_66Views0likes2Comments