macros and vba
6567 TopicsMacros blocked in shared OneDrive Excel workbook as untrusted source
I have a macro-enabled Excel workbook (.xlsm) stored in OneDrive and shared with another user. When they open the shared workbook in Excel Desktop, they receive the error: "Microsoft has blocked macros from running because the source of this file is untrusted." We've already tried enabling macros in Trust Center, adding Trusted Locations, and opening the file from a synced OneDrive folder rather than Excel Online, but the error persists. Since downloading the file creates a separate copy and defeats the purpose of a shared workbook, what is the correct way to allow VBA macros to run in a shared OneDrive-hosted workbook while keeping everyone working from the same file?34Views0likes1CommentMacros in Excel Programs
I am developing a macro enabled spreadsheet that creates a second macro enabled spreadsheet upon exit. Is there a way for the macro in my main spreadsheet to create UserForms and Modules in the second spreadsheet? My goal here is to distribute the second spreadsheet to users and their use of it will be controlled by the UserForms and macros within it.31Views0likes1CommentExcel Macro Creating a New Macro Enabled Spreadsheet
I have a macro enabled spreadsheet. I have a macro in this spreadsheet that is trying to create another macro enabled spreadsheet. I can create this new spreadsheet and save it as a .xlsm file. However, I want to give this spreadsheet a name and transfer data to it by toggling between my two sheets (Windows(Filename).Activate) and not save it until I am done. My problem is that the only way I have found to name it is with SaveAs statement. If I could find out what name Excel assigned to this workbood when I created it, I could work with it - but I have not found a way to do that. If the above is confusing, I am sorry. In simple terms, I want my macro to create another macro enabled spreadsheet, name it, work with it and Save it without using SaveAs. I can provide code, but I thought I would start with this.Solved37Views0likes2CommentsPivot Table
Hi everyone, I have an issue with the pivot table. There are filters from slicers and row labels in the table; when I double-click on any category from the table to see the filtered data, Excel fetches all data, not just what I filter on. Like below, I filtered from the slicer, and from the row labels, (Bills) should be between 100,000 and 200,000. I would like to see the (Bills) for (Central) in the (Start), but it gives me 632,478 and bills less than 100,000 and 200,000, not the 3 clients. Even if I tried from (In Progress), it's the same; it brings all data. The issue is only with the Bills column, but other filters come up correctly25Views0likes0CommentsSeries fill a formula down a column automatically skipping a set number of rows
I am trying to fill a formula down a column every 6th row but incrementing the variable in the formula ($A2) for each entry. The formula uses the Take command and inputs 5 rows of data, so to keep it from "spilling" I need the formula to increment every 6 rows, having one blank row between each section. I have been able to accomplish "copying" it each 6th row with VBA #1 and filling the series with VBA #2 but can't figure out how to combine the two. Any help would be appreciated. VBA #1: Sub FillEvery6thCell() Dim ws As Worksheet Dim startRow As Long, lastRow As Long, col As String Dim formulaText As String Dim r As Long ' Set your sheet and parameters Set ws = ThisWorkbook.Sheets("Top 5 Employees") col = "A" ' Column to fill startRow = 10 ' First row to start filling lastRow = 60000 ' Last row to fill ' Get the formula from the starting cell formulaText = ws.Range(col & startRow).Formula ' Fill every 6th cell For r = startRow + 6 To lastRow Step 6 ws.Range(col & r).Formula = formulaText Next r Range("A2:A60000" & iRow).Replace What:="@", Replacement:="", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False, FormulaVersion:=xlReplaceFormula2 MsgBox "Formula copied to every 6th cell in column " & col End Sub VBA #2 Sub FillFormulasDown() Dim sourceCell As Range Dim fillRange As Range ' Define the cell containing the formula Set sourceCell = Range("A2") ' Define the target range Set fillRange = Range("A2:A5000") ' Fill formulas down sourceCell.AutoFill Destination:=fillRange, Type:=xlFillSeries End Sub125Views0likes6CommentsNames in Excel Name Manager
I have a spreadsheet ( I will call it spreadsheet "A") driven by macros that creates a new worksheet each month. I am developing a second spreadsheet I will call it spreadsheet "B") that links to it for a monthly summary. I have given all the cells names that are to be linked. The issue I am dealing with is when a new monthly tab is created on "A", I want the links from "B" to be updated to the new month. The approach I am taking is to delete all of the names in "A" and recreate them for the new month. (The reason I want to delete the older names is because over time, the Names list would grow into a very large list of obsolete names). The problem I am encountering is that when a name is deleted, a dialog box appears that the user has to acknowledge that, Yes, I want to delete this name. I want to make this process transparent to the user. So, my question is: Can I delete a name without generating this dialog box?Solved106Views0likes1CommentMacros being blocked in Excel even though file is located in trusted site
I am experiencing an issue that I have seen several discussions about, however there does not appear to be an answer so I wanted to see if anyone has found an answer for this. I have a user that is getting the following message in excel when opening a file on a network share: Microsoft has blocked macros from running because the source of this file is untrusted. I have confirmed that the file location is in the Trusted Center and in addition, this issue just started happening recently with no changes that I am aware of. I have also placed the server IP and Server name of the server in the Trusted sites under Internet Options, but this did not change the issue. Here is some info about the system: Windows 10 Pro 10.0.19045 Build 19045 Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20124) 64-bit28KViews0likes5CommentsExcel-Vba
Hi, I have an Excel Workbook Having 5(Five) No’s of Excel Sheet in named 1) DASH BOARD,2) Sheet1,3) Sheet2,4) Sheet3,5) Sheet4. In DASH BOARD Sheet there is 4(Four) No’s Button exist in named GoToSheet1, GoToSheet2, GoToSheet3, GoToSheet4, by on which pressing I go to schedule Sheet. For this I have VBA Code as below. This Excel Book looks as is usually the case with normal Excel Book. Sub Go_To_Sheet1() ThisWorkbook.Sheets("Sheet1").Activate End Sub Sub Go_To_Sheet2() ThisWorkbook.Sheets("Sheet2").Activate End Sub Sub Go_To_Sheet3() ThisWorkbook.Sheets("Sheet3").Activate End Sub Sub Go_To_Sheet4() ThisWorkbook.Sheets("Sheet4").Activate End Sub Now I want VBA Code to hiding of 4(Four)Excel Sheet (Sheet1, Sheet2, Sheet3, Sheet4) except “DASH BOARD” Excel Sheet of this Excel Workbook. Actually when I want to open this Excel Workbook, only “DASH BOARD” Excel Sheet will be visible. When I want to perform any Excel Sheet of this Excel Workbook so that I can open the Excel Sheet by clicking same named BUTTON. After that the schedule Excel Sheet will be disappear by close (X) when task is complete, and again “DASH BOARD” Sheet will be visible only. Being new to VBA looking for VBA Code in this regardsSolved123KViews0likes10CommentsHow to split Excel file into multiple files?
I’m facing an issue with a very large Excel workbook and need some help. The file contains thousands of rows of data, and now it has become extremely slow to open, edit, and share through email. Sometimes Excel even freezes while working on it. Because of this, I want to split the Excel file into multiple smaller files, but I’m not sure how to do it properly without losing formatting or data. I tried manually copying rows into separate files, but it is taking too much time and there are chances of missing important records. I also searched online for solutions, but most methods seem complicated or only work for small datasets. This Excel file is very important for my office work, and I need a reliable way to divide it into multiple files based on rows or column values. If anyone knows an easy method, VBA solution, or any trustworthy tool that can split Excel files automatically, please share the steps. Any help would be greatly appreciated!450Views1like5CommentsA new Excel Think Tank
After nearly 30 years of using Excel commercially, I am now coming to retirement. But before I finally hang up my Excel boots, I have setup a small Excel think tank. The idea being people can send me their issues and I will work with you to build your permanent solution in Excel. I have created a number of solutions from Email Validator, Automatic dashboard creators, Fraud analysis, Auto resume makes, Music Syns (All in Excel), so if give it try.83Views0likes0Comments