216,503 questions
1
vote
2
answers
97
views
Automatic Row in Table
I'm creating a simple (i think) table and just wanted to be able to input the data on one sheet, click a command button and automatically add a new row to a table with that data.
Anyway I found a good ...
2
votes
2
answers
98
views
Create Excel file off of unique name and policy numbers from another excel file with only those policy numbers per unique name
I am trying to generate new files from master copy where each unique name, where it has only the policy numbers that belong to that name. A name can have many policy numbers. I can create the file ...
0
votes
1
answer
102
views
VBA: optimizing userform checkbox values for filtering
I created a macro that filters and formats an Excel file with a few thousand lines based on a fixed list of 10 errors (all contained in the same column), and it works just fine.
I then decided to try ...
9
votes
2
answers
2k
views
VBA vbscript regular expressions crashes
I have a complex VBA project which I have used for ten or fifteen years with no issues. All of sudden, today it started to crash with a non-VBA error message. I am guessing this is referring to the ...
-5
votes
1
answer
125
views
Moving a row with specific data in a column to another location in sheet
I have a spreadsheet with multiple rows coming in with a variety of "RallyType" in column A. I want to move rows that for example: if column A Contains word "Presenters" then move ...
0
votes
2
answers
110
views
SAP Script Recording - short code recording issue
When I record a SAP Script on my computer, it is recorded in what it seems to be a "short" version of what I'm doing, not showing the fields names or anything like that. An example below:
...
0
votes
0
answers
71
views
How do I use a macro in vb to loop the contents of a directory? [duplicate]
I've created a macro that works on any open .docx file.
I'd like my VBA code to point a MS word macro to a directory and apply it the macro to all .docx files.
Is there a snippet that I can put in the ...
0
votes
1
answer
63
views
PowerPoint VBA - Display the Icons Task Pane on macOS
As part of a customised VBA-based add-in, I've been trying to display the Icons task pane which idMSO is "IconInsertFromFile" (button type) but which doesn't work on macOS, although it runs ...
0
votes
0
answers
121
views
Faster way to display formatted Excel cell content in UserForm control without long loading time
I have a ListView and a WebBrowser in my UserForm.
The ListView contains all projects (1 project per row) from the Excel worksheet.
As soon as I select a project in the ListView, the content of a cell ...
1
vote
4
answers
133
views
Apply the same code, but in different columns
I already have the code I need. I just need to apply this code in different columns and I'm not being able to do it that. Right now, I'm only able to apply it in one column. That's the code below:
...
2
votes
1
answer
86
views
NavigateArrow doesn't go to all dependent cells
In Excel VBA, I'm trying to use NavigateArrow to iterate through all of the cells whose formulas are dependent certain cell.
First, here's how I have the sheets set up:
Sheet1, cell A1: I have a ...
2
votes
2
answers
71
views
Multi Color databars in cells + labels?
Is there a way to create multi-color databar in cells based on values ? and add label on top of each cell ?
Conditional formatting is complicated for this (even impossible ?). Do you think vba ...
-2
votes
1
answer
166
views
Can you read the footers/headers of a workbook without opening it?
Short version: Basically im writing a program that searches through 30,000 files on a semi-regular basis, and it would drastically narrow down the search if i could read the footer in the excel ...
0
votes
0
answers
169
views
How to make timestamp generated with NOW() a static value
I designed an Excel tool that when cell X is selected, cell Y puts in a NOW() timestamp.
I want a hidden cell to hold a live clock to calculate the time between the fixed stamped time and the live ...
0
votes
0
answers
124
views
Excel VBA function Not Updating its Parent-Executing form
I have created a huge VBA analysis code set (5000 lines+) that interrogates PLM (Aras, Windchill) design data to determine what division of a multi-divisional corporation created (owns) the part data.
...
0
votes
0
answers
67
views
How to make multiple SQL statement transaction atomic in MS Access? [duplicate]
I needed that both DELETE SQL statements will be performed, or none of them. The tables are linked to SQL Server.
I tried this:
Private Sub onDelete_Click()
On Error GoTo HandleErr
...
0
votes
0
answers
88
views
How to extract R_HOME from user account environmental variables (upper part)
I am using Environ() to try to extract the R home path from environmental variables, however, it seems that Environ() only works with the lower section of the environment variables. My access is ...
-2
votes
1
answer
83
views
VBA Macro to Convert dates to “MMM” with VBA and paste as values
I have a column in Excel that contains dates. Normally, I add a column next to it and use the formula =TEXT(A1,"MMM") to get the month abbreviation like “FEB”. How can I do the same with VBA ...
0
votes
1
answer
133
views
How do I force refresh a PowerQuery with VBA?
I'm trying to automate a workflow with a macro, but I can't seem to get the PowerQuery table to update with VBA.
Sub DepartmentalBudgetsMonthlyUpdate()
Dim wb As Workbook
Dim fName As String
...
0
votes
1
answer
81
views
Keep focus on textbox after pressing the down arrow
I am trying to have the up and down arrows change the value of a textbox in my userform when pressed.
The userform looks like this
and the code for it looks like this
Option Explicit
Private ...
-3
votes
1
answer
119
views
Excel macro that synchronizes zoom and position in structurally identical worksheets [closed]
Goal: I tried to write an Excel macro that synchronizes zoom and position in structurally identical worksheets to improve workflow.
Input, Progress: The macro (see below) works, considers worksheets ...
0
votes
1
answer
155
views
My VBA code for creating a validation list in a workbook throws an error in method add formula1, but it works if I create it manually
This is an Excel VBA problem I can't solve.
I have a quite large and complex workbook, with many sheets. The main working sheet is named "Riassuntivo". In it, I create by code different ...
0
votes
1
answer
131
views
MS Access VBA open a record set using a union query in which each query in the union reference two form date fields: FromDt and ToDt [duplicate]
When creating a recordset I get this error => 3061 To Few parameters, expected 2. How can I resolve this error?
I have a union query and it runs fine:
SELECT * FROM q_trip_usa
UNION
SELECT * FROM ...
1
vote
2
answers
144
views
VBA macro - problem with Application.ScreenUpdating
I have a problem with ScreenUpdating which I want to disabled.
I have a power query connection which is refreshing. I connect excel files from folder in power query , after that I disabled background ...
0
votes
0
answers
148
views
Keep Excel scrollbars non-visible
I turned off all of the elements when opening Excel. It makes it look like an application.
I have a button that opens a User Form. An apparent side-effect of that process is that the scroll bars ...
-2
votes
1
answer
110
views
Close Workbook issue [duplicate]
I have a macro in an .xlsm file. This file is being called through a VBScript. After the VBScript runs the macro, it calls objWorkbook.Close False.
VBA (in the workbook):
ThisWorkbook.Worksheets(...
0
votes
1
answer
75
views
prevent selenium from loading whole page using vba
driver.get "https://www.ambito.com/contenidos/dolar.html"
I want to stop loading after a determined amount of time or once I've got the elements that I need. I tried lots of things, but &...
0
votes
2
answers
107
views
MS Access: Entering Record With Apostrophe Produces Error
I have an MS Access form for entering song performances. It looks up titles from a table. If the title isn't there, it asks if you want to add it.
Private Sub SongTitle_NotInList(NewData As String, ...
0
votes
0
answers
78
views
In Solidworks VBA Code, how do I dimension a sketch from an unnamed edge?
I'm making a code in SolidWorks VBA that will automatically model revolved rectangles onto an imported conical solid body with an axis going up the middle. The revolves are placed on angled planes ...
1
vote
1
answer
96
views
Conditional formatting in Excel for product codes with specific prefixes
I need an Excel conditional formatting formula or VBA to identify product names in a column to highlight cells red if the product name contains two or more sub-products (number+letter codes like r600, ...
0
votes
0
answers
46
views
Excel VBA - Apply complex formula within Formula Bar [duplicate]
Good evening,
Wondering if I can get some help with some VBA code.
In summary, I'm compiling multiple reports out of our ERP system into an overall summary table. However, as some of the information ...
1
vote
0
answers
122
views
Excel XLSM with VBA multi user issue
I have a challenging issue with an XLSM file with some macros in a multi-user environment. In this file I have some macros, amongst others one when the file closes - it hides certain sheets, and one ...
2
votes
2
answers
109
views
Lock specific cells without knowing Sheet's name
I have 30 Workbooks with X Sheets that I don't know the names of.
I have a List of Workbooks like:
Example1.xslx
Example2.xslx
Example3.xslx
Each Workbook can have various Sheets with different ...
2
votes
3
answers
116
views
How do I limit an array to a single column in VBA?
I have this code for "Data 1" that I got from an AI ChatBot. I want it to average my values in column B based on if there are duplicate values in column D, and it does this. But now I want ...
2
votes
1
answer
85
views
Is there a way to overule the Selection change event when I am right-clicking the mouse
Is there a way in VBA to differentiate between a right mouse click and a selection change?
My program goes to the Selection change event every time that I click the right mouse button.
Please help
I ...
2
votes
3
answers
101
views
Transpose rows of repeating data into one column
I need to transpose duplicate data in the below column of the selected cell by the number of data after the selected cell in a dynamic way.
See pictures for example.
This is payroll related and the ...
2
votes
3
answers
109
views
VBA how to average data and then identify if data is averaged or not? [closed]
Please see input and output data in the image. The input table is multiple rows of data from the same subject but different timepoints. There are sometimes multiple data entries for the same subject ...
3
votes
2
answers
121
views
VBA if cells between number values then delete row
Have a large data set. there are formulas in cells AX:BA
Below is part of the code:
'Formats cells in column
Range("AX:BA").NumberFormat = "$#,##0.00"
'sorts column BA ...
0
votes
1
answer
84
views
Attachment generated from newly saved file is corrupt
The code snippet below is part of an Excel VBA Version 2507 (Build 19029.20208) procedure to create a PDF file from a worksheet range and create an email with the PDF as an attachment.
The procedure ...
0
votes
0
answers
81
views
How to replace duplicate components by custom property in large SolidWorks assemblies using VBA?
I’m working on a VBA macro in SolidWorks 2025 to scan large assemblies (with many parts and subassemblies), find duplicate components based on a custom property (e.g., part number), keep one master, ...
-3
votes
1
answer
121
views
How to add one to an alphanumeric string? [duplicate]
I've been tasked with creating an automated Purchase Order form in Excel.
I used an automated invoice tutorial as a place to start, substituting out "invoice number" for "purchase order ...
0
votes
1
answer
125
views
How to fix "object/block variable not set" error?
I'm trying to use VBA on Word 2013.
I'm on Win10.
I created a macro a long time ago to format documents to how I want them.
But,now, when I click to run the macro, I get: "OBJECT VARIABLE OR ...
3
votes
4
answers
190
views
How to get next closest value from range value
I have dynamic value in cell and want to get if cell value not found in range then need to get next closest or nearest value that should be greater than cell value if not found using Excel VBA.
For ...
1
vote
0
answers
99
views
What does "platforms" refer to in Microsoft VBA LSet statement documentation?
I'm trying to understand the official Microsoft VBA documentation for the LSet statement, specifically this warning in the example section:
Due to the varying implementations of data structures among ...
2
votes
1
answer
105
views
Indicate when there is no match when comparing Excel data to Access recordset
I'm trying to use noMatch in Excel VBA code.
I have a spreadsheet where a "PackNum" is compared to an Access recordset (query).
When there is a match it inputs the data in Excel.
When ...
0
votes
2
answers
110
views
Deleting rows when a specific time period passes
I've read up on similar questions here and tried various suggestions, but cannot solve what I'm trying to do. I have an Excel worksheet that records dates in column A and other data in succeeding ...
1
vote
1
answer
141
views
VBA macro to accept track-changes deletions gets stuck
(edited to clarify which macros I tried)
I have an MS Word docx with tracked changes, and I'm trying to accept all track-changes deletions, while leaving tracked-changes insertions as they are (i.e., ...
0
votes
1
answer
320
views
excel 2024: compile error in hidden module solvercode
I have Excel 2024 (Microsoft LTSC MSO version 2408 build 16.0.17932.20496 64-bit), everything was working fine until a couple of days ago, then suddenly the Excel SolverCode module stopped working (...
3
votes
1
answer
127
views
Set a dynamic range based on common values in a column
I want to give a "Timepoint" value (which I call a scanRank in the code below) to all the rows in this table based on "Subject ID".
In this example, the first subject is already ...
1
vote
1
answer
107
views
Trapping AppActivate/SendKeys runtime errors
Further to my earlier question:
AppActivate/SendKeys with Excel 365
I am finding that AppActivate/SendKeys runtime errors are not trappable with On Error GoTo... or On Error Resume Next.
This code ...