Skip to main content

Questions tagged [vba]

Visual Basic for Applications (VBA) is an event-driven programming language first introduced by Microsoft in 1993 to give Excel 5.0 a more robust object-oriented language for writing macros and automating the use of Excel. It is now used for the entire Office suite and over 200 non-Office hosts.

Filter by
Sorted by
Tagged with
2 votes
0 answers
189 views

Project I have created a VBA module called Idx which you may find here on GitHub. It is inspired by pluck() and ...
Greg's user avatar
  • 569
4 votes
1 answer
282 views

Lightweight Objects implementation in VBA7 (32/64-bit) As shown here, VB* class instance deallocation becomes exponentially slower the more instances of a particular class module there are. Cristian ...
MDragon's user avatar
  • 51
1 vote
0 answers
121 views

In VBForums I found the following post: Is there a way of retrieving the number of instances of a VB* class from within the class itself? One could store an instance counter in a Public variable in a ...
MDragon's user avatar
  • 51
1 vote
0 answers
143 views

Background I am building a complex, standalone class. It has a property called .Mapping, which should behave like a Dictionary. ...
Greg's user avatar
  • 569
6 votes
1 answer
119 views

I am writing an Excel bookkeeping application that would be suitable for a small business or contractor. The application is based on a book on double entry bookkeeping: https://www.amazon.co.uk/gp/...
arcomber's user avatar
  • 2,551
14 votes
0 answers
612 views

For latest additions, see Edit sections at the bottom of this question. VB6 / VBA is slow to deallocate class instances VB* class instance deallocation becomes exponentially slower the more instances ...
Cristian Buse's user avatar
7 votes
2 answers
340 views

The task is to create sub-tables from an original table (like below) that contain the missing data columns (missing data is highlighted in red). The important part of this task is to make the smallest ...
Luke Wood's user avatar
3 votes
1 answer
174 views

This code works great and does exactly what I want but it takes around 10 minutes for the code for find 150 lineups. I am hoping to get help and learn how to make it much faster. The goal of this code ...
safo2238's user avatar
3 votes
0 answers
159 views

Traditionally, VBA developers rely on the FileSystemObject to retrieve files within a directory. I decided to test and compare different methods (Windows API, PowerQuery, PowerShell, and ...
TinMan's user avatar
  • 4,328
3 votes
1 answer
160 views

I use the below code to loop through a list of data and search through all the sub-folders in a given folder for files which match my requirements. Right now it takes this code about 22 minutes to run,...
J. DeSantis's user avatar
2 votes
0 answers
315 views

Update I have released a prototype (v0.1.0) of my SOb project, which is a generalized framework for easily simulating objects. Background I am writing a VBA module ...
Greg's user avatar
  • 569
4 votes
1 answer
174 views

I'm trying to loop through around 100k files in varying degrees of nested directories using vba and md5 hashing each of those files. Right now, the current state of the program takes around 1.5 to 2 ...
mhabes's user avatar
  • 43
5 votes
1 answer
169 views

Background I encountered this issue a while back, where I tried to "set" the value of a member "in place", without changing its position within the ...
Greg's user avatar
  • 569
3 votes
0 answers
400 views

Part 1 - A fluent unit testing framework in VBA: A fluent unit testing framework in VBA Part 2 - Fluent VBA: One Year Later: Fluent VBA: One Year Later Two (almost three) years have now passed since I ...
Brian Gonzalez's user avatar
-1 votes
1 answer
86 views

I have a chunky VBA script that needs some help making it efficient, which I think will correct the "Procedure too Large" issue I just ran into. I run the procedure from an open workbook ...
WhiteRaven76's user avatar
-3 votes
1 answer
87 views

I have a dictionary with key - data pairs. My data comes from excel sheets. When I create the dictionary my objects are placed in order by their keys ex. 1 -> data of sheet1, 2 -> data of sheet2 ...
tzoni's user avatar
  • 3
2 votes
1 answer
251 views

I have process where I am generating workbooks from a list. One of the tabs has varying height and I have a formula that my macro uses to determine whether to hide a row. As I move to the next ...
Mark S.'s user avatar
  • 211
5 votes
0 answers
216 views

The latest version of the Dictionary class presented in this question is available in the VBA-FastDictionary repository under the latest release. Motivation I ...
Cristian Buse's user avatar
3 votes
1 answer
179 views

I am writing the following VBA code to make a timeline, which I will be using for other parts of the code later on for other calculations and output. I have a userform where the following number of ...
Barbarian's user avatar
2 votes
1 answer
148 views

I have this code for picking items with multiple values from userform and inserting them into a sheet. The code works perfect on my computer, which is pretty decent. But on a computer from work it ...
Santos Lee's user avatar
3 votes
0 answers
504 views

After spending a considerable amount of time poking at the internals of the Collection class, I have discovered 2 methods to iterate a private internal array within ...
Cristian Buse's user avatar
4 votes
0 answers
436 views

I'm looking for some help. I'm new to coding and have started creating this Vehicle database program in Excel for a friend to use. He is wanting to be able to see all vehicles he owns, when ...
Kendall Briggs's user avatar
2 votes
1 answer
179 views

I am synchronizing two MS-Access databases. One of them on a network drive, the other one on the local machine. (For testing purposes both in the same directory) The Databases both contain a table ...
FriendlyFoxFromSpace's user avatar
1 vote
1 answer
202 views

I have used the below code Loop through cells of a range and convert to a hyperlink and change (Text To Display) to an ascending number per each row. it works, but for the point of ascending number I ...
Peace's user avatar
  • 113
4 votes
5 answers
995 views

[edit] I realised why everyone does this with loops; my plan was to use .SpecialCells(xlCellTypeVisible).EntireRow.Address to return the row(s) of the results of the results of the filter, but that ...
Andi Allan's user avatar
5 votes
2 answers
185 views

the below code used to: Concatenate the values on a specific column "N" depend on the value of column "A" then delete the remaining rows. It works, but with range of 30k rows the ...
Leedo's user avatar
  • 275
6 votes
1 answer
806 views

VBA is a language that's lacking a lot of basic functionality. (Pun intended) Most libraries, if they exist in the first place, are OS-specific, and even some of the inbuilt functions don't work on ...
GWD's user avatar
  • 195
2 votes
1 answer
150 views

My code below is used as a back testing tool to review a past Daily Fantasy Sports slate. This code works perfectly but when the contest size (total entrants) gets up to the 30,000 range it takes ...
safo2238's user avatar
0 votes
1 answer
127 views

I have the code such as this for opposite conditions. ...
Geographos's user avatar
3 votes
1 answer
130 views

Basically below code is taking first 7 tabs from my current sheet and pasting them as values in a blank excel sheet with same tab names and saving them in a specific folder by filename I specified. ...
Sorab's user avatar
  • 31
3 votes
1 answer
662 views

I am basically looking for a way to trim below code. It works just fine. This code takes a range from each tab of an excel spreadsheet and pastes it into a powerpoint file, then assigns a title to ...
Sorab's user avatar
  • 31
2 votes
1 answer
301 views

The macro below loops through column E in Sheet2 and finds matches in column Z of Sheet1. If a match is found it copies the value on the same row contained in column AA. It works ok but hangs when it ...
Robsmith's user avatar
  • 123
1 vote
1 answer
571 views

I have an Excel sheet that connects to third party software which populates Sheet1 with data. It does this multiple times per second and overwrites previous data. I have written the macro below to ...
Andy's user avatar
  • 113
4 votes
1 answer
222 views

I'm trying to clean my excel sheet so that all lines match with each other when I put 3 different tables from 3 different data sets next to each other. The code I have gets the job done but it's ...
Milo Sandoval's user avatar
3 votes
3 answers
771 views

I have a simple code that loops through a text file to fix a few things in it and I use mostly dictionaries to find and handle the adjustment. However, with larger files (about 30K lines) it seems to ...
KE_1234's user avatar
  • 31
0 votes
0 answers
135 views

As a learning exercise and to do something productive, I decided to write a VBA macro for one of my "very old" FrontPage websites. Actually I'm in the process of trying to escape from ...
RDK's user avatar
  • 9
4 votes
0 answers
258 views

Background I am trying to recreate the functionality of HYPERLINK() on my own terms, as a custom UDF called Hyper_Link(). My ...
Greg's user avatar
  • 569
3 votes
2 answers
374 views

Background I am working on a VBA paradigm for modifying the Excel environment from a UDF. I call this "sudo mode", and I leverage Application.Run() to ...
Greg's user avatar
  • 569
2 votes
1 answer
135 views

I have a repetitive data reduction where I have a list of ID's that I want to find in a longer list. I have a method, but it is slower than I'd like. How can can I speed this up? The process: After ...
Brandon Murray's user avatar
2 votes
1 answer
91 views

Code explanation: I have a code, which performs two tasks - To open two workbooks, one being extract info and one destination and it compares the column A with Column A of these workbooks and all ...
Rokas's user avatar
  • 23
3 votes
2 answers
291 views

and no, I'm not talking about Workbook_BeforeClose. Note that the motivation of this question is Excel specific but the technique I'd like feedback on is not. If ...
GWD's user avatar
  • 195
3 votes
1 answer
156 views

This code works perfectly as intended but I am fairly new at VBA and want to learn new techniques and way to optimize my code writing. It is a very simple process that involves (3) seperate workbooks. ...
safo2238's user avatar
2 votes
1 answer
246 views

The class assigns various strings to the build number. So the build might look like 3.4.5.1 which would be of the format ...
DanM's user avatar
  • 121
4 votes
1 answer
230 views

I've been working on this project for my organization for a few months now, and am looking for ways to increase performance on this macro. I work for an insurance company as a claims auditor. I get a ...
Dallin DeFord's user avatar
2 votes
1 answer
831 views

I created (basically) an organizational chart in Visio with different levels and want to be able to hide the levels with the press of a button. If I hide level 1 (= top level), all levels below it ...
Alex's user avatar
  • 161
4 votes
0 answers
237 views

A little over a year ago, I asked for feedback on Code Review for a unit testing framework I created in VBA. Development of this project has been off and on for the past year. Sometimes I wouldn't ...
Brian Gonzalez's user avatar
0 votes
2 answers
109 views

I have a couple of VBA loops that work in the blink of eye when I execute them through Excel, but doing this as part of an Access VBA application takes like 15 minutes. The loops run through each row ...
BlueFlame's user avatar
2 votes
1 answer
168 views

I have created the following code: Option Explicit ...
user avatar
1 vote
2 answers
114 views

I am currently running multiple macros on a large volume of files however watching it go through its processes today I realise one of my issue is that my loop runs through my workbooks 3 times instead ...
rmba22875's user avatar
4 votes
2 answers
1k views

Instead of using 45 IF conditions , I put my two ranges into variant arrays. Then I used the below code to loop between them and change values of the first array ...
Leedo's user avatar
  • 275

1
2 3 4 5
26