Questions tagged [vba]

Visual Basic for Applications; a subset of Visual Basic used in all Microsoft Office applications. Consider using this tag together with the tag for the specific application in question. Good questions on VBA generally contain some code and asks for solution of specific issues. Questions asking for entire solutions (please give me the code / how to do this and this with VBA) are off topic and will be closed as too broad.

Filter by
Sorted by
Tagged with
0 votes
0 answers
28 views

Linking columns on different sheets

I'm very new to VBA coding (only dabbling for this specific project), so I would really appreciate any advice on an issue I'm having. I'm attempting to independently link multiple column ranges on ...
thtrmus's user avatar
0 votes
0 answers
59 views

Need help to optimize my VBA code

What I'm trying to do is I want to copy the rows to each different type based on record type. Raw file tab - there are hundreds of thousands rows of data containing 6 different record types. PRPO TAB -...
user2251216's user avatar
-1 votes
0 answers
27 views

Automatically populate a template in excel from table with input values

I would like to have an table with input. Press a button. And use excel to generate 1-20 lines with the same input. For every row of input there are 3 output lines. Simplified Example input table: ...
ansible_usah's user avatar
4 votes
2 answers
281 views

VBA Macro runs successfully then freezes

I am trying to take data that was merged into one cell and retain the first 6 characters of that cell and move the remaining into the next column then proceed through the worksheet. I wrote the ...
Jessie Shepard's user avatar
1 vote
0 answers
22 views

Excel- Product cross reference to return amounts shipped vs received

I'm trying to create a tool that allows a data dump of shipping invoices from my company and invoices filed through the state. Then spit out a table where it's easy to see quantity variances. I have a ...
jcoucanna's user avatar
0 votes
1 answer
51 views

Formula to values once data is entered in another cell

I have columns with formula wherein the result will pop out once a data is entered in column O. Meaning at first these formulas look blank and Column O is like the trigger for the other data to pop ...
JAF's user avatar
  • 1
0 votes
2 answers
118 views

Excel macro to count cells by color and does not count merged cells as more than 1

How can I write a macro that will go through a range of cells and count the contents by color without it counting each individual cell within a group of merged cells. For instance, in the picture, I ...
Jessie Shepard's user avatar
0 votes
0 answers
16 views

Insert MODE.SNGL into a conditional formula pulling data from one worksheet to another

Windows 10 Excel 2019 I have a workbook with two worksheets, Product Data and Product List. The data in Product List is generated each time the formula I am looking for is run. The number of products ...
Bel's user avatar
  • 25
0 votes
1 answer
33 views

Excel VBA - Looping an IF( & VLOOKUP( starting with a partial string

Good day to an amazing community, I am trying to develop a macro to loop through two arrays. Here is an example of how the data is set up: Raw data is found in C4:C1500 $ data is found in D4:D1500 ...
RT2's user avatar
  • 1
0 votes
1 answer
31 views

Removing Content Control Quick Part in Microsoft Word

I have a VBA macro that will auto populate a document with content control quick parts that have blocks of text with other content controls within them. I'm attempting to write a VBA macro that will ...
churchizactiive's user avatar
0 votes
0 answers
27 views

Mentions affecting Regex Validation

I was wondering if anyone came across the issue with Regex validation in Microsoft Outlook when including mentions (i.e.,@Tony or @Jodie). The below code works fine when there is no mentions in the ...
churchizactiive's user avatar
0 votes
0 answers
24 views

Unique ID for Fields and Cross References in Microsoft Word

I am working with a collaborative Microsoft Word Document with Figures and Tables cross referenced throughout the document. For instance, there are 75 figures linked with Captions. We have cross ...
NW_Photo_Laureate's user avatar
1 vote
1 answer
68 views

IN VBA, How to sum hours and minutes exceeding 24 in memory (not in ranges of excel)

I'm getting some data in the format of text(like for example "12:47" that means 12 hours and 47 minutes) from a URL document and calculating some parameters like overtime work, shortages and ...
alireza Seraj's user avatar
0 votes
0 answers
18 views

Automatic change of keyboard language in a worksheet in Microsoft Excel

In Microsoft Excel, and using visual basic, how to set a default language for different columns? For example, columns A & C should be set to English by default and columns B & D to Persian. ...
farshid's user avatar
0 votes
0 answers
75 views

VBA Excel Multiple files saved in newly created folder named with text in cells range and date

I am trying to create a folder and save as copy of my workbook in this folder for all the filled cells in range B11-B14 of my workbook. I managed to create the folder and the file with the correct ...
Caroline's user avatar
0 votes
1 answer
197 views

Excel Macro Code Disappearing in Network Trusted Location

This problem -may- have started around when I switched from Office 2019 to 365, however I've been doing so much upgrades lately (windows 11, server 2022, etc) that my memory is foggy. Over the past 6 ...
Ethan Wade's user avatar
2 votes
1 answer
90 views

Excel VBA Else Without If Error -- I can't seem to find where the error is?

I am configuring a long IF statement, where if the financial period is the same, it merges the cells together under the same period header, and if not, it creates a new header with the new period name....
Matt's user avatar
  • 23
0 votes
0 answers
52 views

Filtering a Table based on a Cell Reference in another workbook, then copying it

I am trying to filter a table based on a cell in another workbook, the reference for the filter would be in workbook "ReportWB" and the "Project Summary Detail" sheet, cell "...
Shayne's user avatar
  • 1
0 votes
0 answers
14 views

Inserting Today's Date In A Cell If Other Cell Values Are Changed or Added using VBA

So I have this spreadsheet that I share with my Team, and I'm looking for a way to have a Today's date put in a cell, everytime there's a change in the worksheet. I found this coding, which is working,...
Marta Hoffmann's user avatar
1 vote
0 answers
87 views

How to run a Word macro from the command line?

I'm trying to save and close all open Word files (to start I only target one of them). The macro I made works when ran from Word (clicking "Execute"), but it won't run when called from the ...
TryingToLearn's user avatar
0 votes
0 answers
88 views

Excel VBA: Export/save won’t work correctly

(Hope the formatting is okay. I’m doing this on my phone, so it’s hard to tell.) So, I’m trying to create some VBA to automate the clean up process of data I get from my field crews. Everything below ...
X-Cell's user avatar
  • 25
1 vote
2 answers
124 views

Excel, update cells when clicking on another cell

I have tried a few different bits of VBA found here on SuperUser but not able to get it to work. I am trying to update a cell when I just click on another cell. I have data in A43:A54, it's a list of ...
Dean Smith's user avatar
0 votes
1 answer
66 views

Replace with wildcards in Excel or batch edit some wrapping formula

I'm only trying to delete some CONCATENATE() function from some formulas in Excel. What I have; here 'Something' could be a lot of things (digits, <, >, texts, etc… CONCATENATE("Something = ...
Seba99's user avatar
  • 101
0 votes
0 answers
39 views

extract VBA userform from corrupted word docm

I have a userform in word built over 10+ years. Today Word chose to crash the normal.docm file and the VBA project became unreadable. I have used python scripts to extract the code, but I don't have ...
MyICQ's user avatar
  • 242
0 votes
0 answers
83 views

Highlighting duplicates in Excel with VBA, multiple sheets

I have a workbook set up with a sheet for every month and then a summary sheet, so 13 sheets total. Each sheet, other than my summary page, have two sets of tables set up. A table for each week in ...
Aisha Stayer's user avatar
1 vote
1 answer
138 views

Macro for using Goal Seek over a range of cells

I'm trying to automate the GoalSeek function over a range of cells. Each cell in Columns I and J calculates a quantity of interest using two different methods, and the results must agree. Each cell in ...
Alan's user avatar
  • 11
0 votes
1 answer
342 views

Any way to allow multiple people to edit a coauthored, password protected workbook, at the same time?

I am currently working on a sheet that I want select people to have full access to, while everyone else without the password for the sheet cannot. I can do mediocre and overly complicated solutions ...
Thomas Wohllaib's user avatar
0 votes
1 answer
208 views

VBA - Copy Visible cells not selecting everything

I have a very long macro that I've written that looks at a report sheet, breaks it down by many different criteria (putting some of the results on different sheets), and does hundreds of calculations. ...
Jordan's user avatar
  • 37
1 vote
1 answer
36 views

Formulas corresponding to the correct table in my sheet, vba. Multiple tables across multiple sheets

I am setting up a cycle count sheet using VBA. I am having trouble with the formulas in my tables only referring to the first table in the sheet for the input values. For example, I have 4 tables per ...
Aisha Stayer's user avatar
1 vote
3 answers
131 views

Convert an Excel table from one structure to the other

Original table I have this table in Excel or LibreOffice. Unit number Type Name 1 Object Top 1 Object Bottom 1 Object Left 1 Object Right 1 Object Back 1 Object Front 1 Property Right-Fixed 1 ...
Megidd's user avatar
  • 271
0 votes
1 answer
88 views

Excel for Microsoft 365: Obtaining the Default Column Width

I am using VBA in Excel for Microsoft 365. I wish to obtain the default column width and store it in a Double variable. This is driven by the desire to not hardcode it. I have attempted to obtain this ...
Dave's user avatar
  • 1,019
0 votes
1 answer
92 views

Evaluate returning #VALUE? when trying to calculate large VSTACK

I am working on a project that is pulling a bunch of spilled data across a ton of sheets that are all in the same spot as the sheets are based off of a template. Using the name manager I was able to ...
Thomas Wohllaib's user avatar
2 votes
1 answer
71 views

MS Access replace function is not giving the expected result

I am concatenating two fields, however in some cases the second field begins with \, but not always. I'm trying to remove the possible extraneous \ using replace. stDigitalFolderLocation = ...
Ali Kayn's user avatar
-1 votes
1 answer
214 views

VBA Code to hide rows on multiple sheets

Very new to this so. Is there any way to have the option cell K473 be on tab 1 and change the hidden rows on tabs 2 to 11? The below works perfectly on a single sheet, but would like to have the ...
John 's user avatar
5 votes
1 answer
549 views

Making it so users that do not have macros enabled cannot see other sheets

I am working on a project that wants all users to have macros enabled. It is a shared sheet so I cannot simply hide everything as a baseline and unhide the sheets when Open_Workbook is ran. My goal is ...
Thomas Wohllaib's user avatar
0 votes
0 answers
29 views

Excel VBA Macro

i need help for problem below:- when have an empty row, i want next data to fill in on those empty row i want data row 16 move to empty row 13 enter image description here For C1 = 1 To 273 Step 46 ...
Engr Muhd Afizul's user avatar
0 votes
0 answers
54 views

Unable to edit the required text and update auto-date

I Should be able to edit any text updated except , "Posted", "Closed" in J Column. Every time I edit the text the date should be auto updated in next column cell. For example, I ...
raju nagavelli's user avatar
0 votes
0 answers
73 views

Any way to disable the Accessibility Checker on a Workbook

I am working on a project that for security reasons needs to have the accessibility checker disabled. Although through settings I can disable it on my excel, I need to find a way either through VBA or ...
Thomas Wohllaib's user avatar
0 votes
2 answers
263 views

Making a workbook only able to be opened in the excel desktop app

I am working on a project that requires all of the users on it to be on the desktop app for sheet security reasons. The sheet security can be bypassed by simply not having VBA run by opening the sheet ...
Thomas Wohllaib's user avatar
0 votes
0 answers
131 views

How can I recover vbaproject.bin from my corrupt powerpoint.pptm file

I have a .pptm file with 70 hours of code work in it. It has become corrupted and I have no backup (very stupid I know!). What I do have is the .ppam which was generated from a slightly earlier ...
kwibbler's user avatar
0 votes
0 answers
107 views

Outlook 365 VBA to access entries in a group mailbox contact list

I don't know if this is possible but I want to insert into the To of an email, an entry from the contacts part of a group mailbox address book. I have managed to find the code to show the contact list ...
Fritzybabe's user avatar
0 votes
2 answers
107 views

Excel macro to split the date and time in one column to two separate columns

The code created by the macro works just fine, but looks clumsy. Can anyone assist in cleaning this up so that I can learn to make the recorded macros cleaner going forward? Sub SplitDateTime() ' ' ...
Iron Man's user avatar
  • 103
0 votes
1 answer
303 views

Creating a VSTACK'd array from a changing list of spilled references

I am working on a project that requires a large 'pool' of data to pull from and sort from. To keep the workbook efficient, the data is kept in sets of SPILL's, as pulling a raw selected range for the ...
Thomas Wohllaib's user avatar
-1 votes
1 answer
64 views

VBA "Block If without End If" Error on Worksheet Change

I have a spreadsheet that uses data validation to create dependent dropdowns for several of the cells that have specific values in a database. Even with the dependent dropdowns a user can still enter ...
droberts26's user avatar
0 votes
1 answer
71 views

Hidden Personal Macro Workbook Opens upon running macro to close ActiveWorkbook

I have a macro that I have coded to close the activeworkbook after running a series of formatting and saving it as a PDF. However, it opens a hidden version of the personal macro workbook immediately ...
churchizactiive's user avatar
0 votes
1 answer
49 views

PowerPoint VBA - Slide Show - Win11 not updating Slide Content

I have a PPT slide deck (2 slides) saved as a PPTM file that are used as a countdown timer where the time remaining is controlled by VBA on slide 2. It used to work properly when I was on Windows 10 ...
psycoperl's user avatar
0 votes
1 answer
30 views

Using Javascript in TextExpander to validate text on the clipboard and make it Bold

I'm not sure if this is possible but essentially I haven't been convinced to switch to the new Microsoft Outlook because I value the functionality of VBA. Specifically, I use VBA to always validate ...
churchizactiive's user avatar
-1 votes
2 answers
131 views

Pop out emails in folder pane only when in reading reply/foward pane? [closed]

I have a code that I want to (upon manually running the code) pop out the email in the folder pane to a pop out window. I only want it to do this whenever I am currently drafting a reply/forward. ...
churchizactiive's user avatar
2 votes
1 answer
48 views

Separately color all rows for unique clients listed in one column

I am a relative Excel noob, and to that end, forget about Excel macros. I'm here because this seems to be where the GOATs congregate, and I really need some help. I have an enormous data set that ...
alm's user avatar
  • 23
0 votes
2 answers
448 views

How to handle protected view errors in Excel VBA macro

Introduction. I have a local website, and one of its pages is used for downloading an Excel report by several users on their PCs. The file is automatically generated with some data from our database ...
Garry Gorn's user avatar

1
2 3 4 5
75