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.

learn more… | top users | synonyms

1
vote
0answers
6 views

Excel VBA counting total-of-rows written on current day

On my work I maintain an Excel-sheet which contains information about the incident-tickets I've processed. I've enhanced the sheet with some VBA-code which I use the following way: In the beginning ...
1
vote
0answers
7 views

Moving a value into another cell IF the destination does not have an adjacent border OR contain certain text

I've created a macro that finds the letter "O" in a range, then moves it up one cell if the destination cell does not have a "." or an adjacent border. It works fine, but I've heard that the use of ...
5
votes
1answer
32 views

Crawler for scraping and approving friend requests in Facebook

I've made a Facebook scraper using VBA in combination with selenium which is able to parse the name from friend request list. It is necessary to do one thing manually, though. After running this ...
4
votes
1answer
54 views

Scraper for a lazy-loading webpage

I've written a script in VBA in combination with selenium which is able to scrape all the 1000 links from a lazy-loading webpage which displays it's content 20 at a time and doesn't display the full ...
1
vote
0answers
44 views

VBA code that compares values and chooses the lowest [on hold]

I'm new to VBA and I tried to learn it in about a week or so, In these few lines of code I have to compare more prices, choose the lowest and write it to a defined cell, predefined, above the others. ...
-1
votes
0answers
24 views

Finding names in columns

I am looping through column 3 to find all the names. If I find the name then I go to the corresponding column to find a number then search for the number in column A, then go to the corresponding ...
2
votes
0answers
53 views

Speeding Up My Current Code Inventory Management Planning Screen

I first want to apologize for dumping a lot of code into here, but I have been stuck on this issue for days. I was assigned to build a planning screen wherein I could pull corresponding information ...
1
vote
1answer
37 views

Unoptimized VBA macro that edits cell values based on a partial string

This macro is used to check if a partial string is present in a cell. Since the partial string is part of a product reference number, I have a lot of combinations. Is it possible to write these ...
0
votes
0answers
14 views

Search a Workbook, Then paste results on Search Page.

I posted this earlier this week, but I am finally done with it, and I am submitting it tomorrow. I wanted to get a final opinion/review from anyone on anything that could be refined. This code ...
-4
votes
0answers
22 views

Converting windows excel vba code compatible with mac [closed]

I have the following 4 codes working perfectly on a Windows pc. The problem is, it is not working correctly when used on a Mac pc. I have no experience coding vba on mac platform and no mac pc as ...
3
votes
1answer
48 views

Select highest and second highest values

i've written a procedure to where it selects the first and second highest values not already selected (as designated by previous highlights of green and yellow). The first highest ignores anything ...
1
vote
1answer
49 views

Searching an entire workbook for keywords and then printing the results on another worksheet

I made a search page at the beginning of a work book. This page has a drop down that allows you to choose what category to search in, then you type your phrase or keyword into the search box and it ...
3
votes
0answers
32 views

Creating / Uncompressing zip files in VBA revision

This is a followup code review request for a previous post: Creating / Uncompressing zip files in VBA I did most of the suggesttions presented in the last code post, but as I significantly improved ...
1
vote
1answer
40 views

Add spaces around variable with $ symbol bookends

I have some code in a particular coding language, and I am trying to clean it up by adding spaces around the variables. I wrote this code, and it works on small amounts of text and if I set a break ...
6
votes
2answers
68 views

Creating / Uncompressing zip files in VBA

I work for a company that makes industrial secondary packaging machines. (Our machines put stuff in cardboard cases.) The machine can run several different sets of parameters for various product and ...
1
vote
1answer
47 views

VBA script to add formulas to Excel is running slow

I have written the following VBA script that searches for a text string in column CI and if it finds it the specific text the script adds a formula to a series of cells. The script itself runs ...
2
votes
0answers
44 views

Scraping data from json response using twofold request

I've written a script which is able to get javascript encrypted links from a webpage and then using those newly produced links by making another request It can reach the target page and going there it ...
1
vote
1answer
31 views

Mass Queryer Works Around Database Expression Limits

With thanks to @BrandonBarney for his encouragement, here is a program I wrote to automate massive data pulls for my team. Warning: I included all the methods in case anyone wanted to see all of them,...
0
votes
1answer
49 views

VBA faster calculating

I'm newbie in VBA world. I have recently work with a spreadsheet with over 25000 rows and about 50 columns. Every time I calculate this sheet, it takes about 30 minutes to 1 hour to perform the ...
1
vote
2answers
38 views

Calculate Threaded Pipe Lengths and Component Counts to Build Plumbing System

How can I make this code more efficient? The purpose of the code is to receive input from the user and then calculate threaded pipe segments and components that are required to build the system. As ...
2
votes
2answers
45 views

Multiply a 2D array by 1D array to get a third (2D) array

I've working with three dynamic arrays (all are datatype Double) - they are OriningalArray This will be assigned from a range that the end user will see and ...
4
votes
0answers
40 views

Web scraper for Yell

I have created a scraper for yell.com in vba. The scraper is efficient enough to pull data from that site, whatever the search parameter is. If any link from that site is given to my parser, it is ...
2
votes
1answer
72 views

Delete unmatched rows in Excel

I'm looking to optimize my for loop to search faster. I've turned off ScreenUpdating, EnableEvents, Calculation, and DisplayStatusBar to speed it up a litte. I have about 10,000 rows to search for in ...
0
votes
1answer
57 views

Speed up search/replace in VBA Word

I have a word document with 450 pages (and growing) in witch I make a search and replace (linking referencies) after inserting new text. Unfortunately this procedure is very slow. Have you any ...
1
vote
0answers
54 views

Scraping json data using vba

I've created a scraper using vba which is able to parse json response. When I was thinking of using scripting dictionary or json converter to scrape json data I could notice that applying split ...
4
votes
1answer
63 views

Compare two columns and fill in a third column

I want to find out the records with same group from Column AS in Column AT and add missing invoices in Column AU considering all the values from the group in Column as below table: Jan|Feb|Mar|...
2
votes
0answers
41 views

Scraping table data from websites

I've written a script in vba to parse table from any website if the html elements are not encrypted in javascript. There is a table index in my script in which inputting the right number it is ...
3
votes
1answer
40 views

Parsing Title from any given website

I've created a very small script in vba to parse Title from almost any website. I've checked it with few websites and it is providing with the accurate results. I used split function on responsetext ...
4
votes
1answer
57 views

Retrieving mail attachments given criteria with VBA

Scenario: I (together with great help from SO) finished this piece of code which downloads attachments from an e-mail account (outlook) with VBA. Issue: Given the internal functioning of the code, ...
4
votes
1answer
68 views

Scraping a whole site using vba

I've created a parser which is able to parse the full content of houzz.com. After going to the given address, it parses the sub-category links from the left sided bar. Each sub-category links spreads ...
2
votes
2answers
102 views

Scraper for Redmart.com

I've written a script which is scraping a webpage encrypted within javascript. The scraper is extracting name, price and image link of certain products from that page. I used selenium in combination ...
5
votes
1answer
46 views

Merging List Arrays

Some utility functions I re-wrote today: Purpose: Given an arbitrary list of 1-D arrays (possibly empty variables), return a 1-D array containing unique values from all lists. Ex: Given (1,...
2
votes
1answer
95 views

Class to update a userform with an external workbook and vice versa

Everything is working fine; it just works too slowly. Specially, when there are 3 workbooks that a single Userform needs to open and update 3 ...
4
votes
3answers
94 views

This macro will convert you… or not

I'm developing a macro that converts a text file, hence the attempt for a funny title, or cringy, opinions may vary! Context and Objectives I was assigned a project to replace a old legacy program ...
1
vote
0answers
42 views

Excel VBA - searching PDF using FindText three times per doc

It takes a very long time for some files to be searched. I need to do this with 1000+ PDFs. It seems to be held up during the FindText operation. Any suggestions? ...
1
vote
0answers
33 views

VLookup simulation: copying data from one sheet to another

I tried to write a VLOOKUP in my macro but for some unknown reasons it didn't work (see my post on StackOverFlow for more info. So I decided to do a macro which achieves the same result, but it takes ...
3
votes
1answer
49 views

User-defined function to split a 1D array into 2D array

The purpose of the UDF is to receive a 1D array and split it into a 2D array. The size of the new array should be dynamic. ...
3
votes
3answers
71 views

Capture worksheet formulas in VBA format

I had been searching for a simple way to capture worksheet formulas in VBA format. I came up with a solution below, which I wanted to share. With any luck this could be useful to someone down the ...
2
votes
2answers
51 views

Match formula for loop in VBA

I am using a match formula inside of a for loop, but it is taking too much time. Is there any way to optimize this code to make it go faster? ...
11
votes
2answers
206 views

Using events together with interfaces in VBA

Introduction Because of the limitation of VBA in using events in interfaces I was searching for a kind of workaround. For sure I also read this which also provides an approach, but I was searching ...
3
votes
0answers
36 views

SUMIFS3D User-Defined-Function

I wrote user-defined function in Excel, but it seems to slow down work significantly. Function performs sumifs for several worksheets in workbook. Could you advise me, please, on potential ...
3
votes
1answer
73 views

Return a substring containing a certain pattern to VBA

I've written in a C++ dll the following function to return to VBA a substring containing a certain pattern, given an input string, which contains that substring: ...
1
vote
1answer
45 views

Fast edit of Excel CSV format file and save to specific folder VBA

The below code is working I just need a review as there are somethings that I think I might have done wrong. The code will edit the raw data of an excel CSV comma delimited file moving all text using <...
6
votes
2answers
84 views

Retrieving database values through properties

I have a Settings table which I make frequent DlookUp calls to retrieve values. So I thought instead of having to write ...
1
vote
1answer
30 views

SQL to list function - turning a table column into a delimited list string

I wrote this very "general use" function, because I needed that in some reporting. I was wondering if there is any suggetsion for improvement. ...
1
vote
1answer
47 views

Merging cells in multiple columns on multiple sheets

This code merges cells in multiple columns on multiple sheets, and it's too slow. I'm hoping for any help at all to speed this up. Unfortunately, I'm not able to get around the fact that the cells ...
1
vote
1answer
87 views

Converting an Excel range into an array

I'm iterating through a list of possible values that reside in a named range on a worksheet. Since accessing ranges is slow, I wanted an easy way to convert them to an array and came up with the ...
3
votes
1answer
62 views

SAFEARRAY export from a C++ DLL to VBA

My code is not very elegant, but I'm a total newbie in c++ and I consider it already a major achievement that I managed to write something that actually works. As background, I'm defining in VBA the ...
1
vote
2answers
62 views

Matching values to a lookup worksheet

I have a worksheet that contains values, and I need to match one of the values to a lookup worksheet. This syntax works like it should, however, it takes roughly 10 minutes to fully execute. This ...
9
votes
1answer
78 views

Drawing Fractals with MS Excel VBA

I've made Excel VBA code that draws and fills a fractal pattern. I know there's a few more ways to optimize the code, just glad it works right now. ...