Questions tagged [excel]

Microsoft Excel is a commercial spreadsheet application written and distributed by Microsoft.

Filter by
Sorted by
Tagged with
13
votes
1answer
2k views

VBA Class to persist and restore Excel Application properties

Very often on Stack Overflow, and even on Code Review, I've seen questions and answers that have code that begins by persisting Excel properties like DisplayAlerts ...
7
votes
1answer
295 views

Comb Sort in VBA

Playing off Robust Bubble Sort in VBA and as suggested by @Henrik, I took a look at comb sort and tried to create an algorithm based on the documentation solely on Wikipedia. Basically, the first ...
1
vote
2answers
377 views

Retrieve data from eBird API and create multi-level hierarchy of locations

As you may know, I like birds. The Cornell Lab of Ornithology has a tool called eBird where you can submit records of the birds you identified. I recently learned they have an API that I can query, ...
5
votes
2answers
121 views

Parsing cells containing Line Feed Characters

Link to sanitized xls on dropbox if test data is needed Essentially the reports I work with aren't bad - The issue is the way it exports to excel - With the problem being that these cells are ...
6
votes
1answer
419 views

Non-standardised data across multiple worksheets: Aggregation, Validation, Filtering

Every piece of business that gets written (E.G. an adviser's client puts an additional £10k payment into a pension plan) goes in a spreadsheet called the SubSheet. It's split into 8 worksheets for ...
6
votes
1answer
452 views

Looking up ingredients and creating a shopping list

This is my first attempt at refactoring - FindIngredients and I'm wondering where I can improve. The github link in the code directs to the project that still has ...
4
votes
3answers
225 views

Brute force looping & formatting Or Create Union range & Format? Which is efficient and when?

May be my question is not up to the standard for Code Review, but of upmost importance for reassessing methods used in my VBA coding . While preparing/testing answer for a SO post (thought to simplest ...
2
votes
1answer
179 views

Part 2: Send HTTP request for each row in Excel table

This script was previously reviewed here: Send HTTP request for each row in Excel table (Part 1) I've made the changes that were suggested in the Code Review answers as well as added a few of my own. ...
7
votes
0answers
2k views

Responding to Events of Dynamically added Controls

I was asked for an example of a class to wrap dynamically added controls as I suggested in this Answer. Although it is out of the context of a Code Review, I thought that it would make an interesting ...
19
votes
1answer
5k views

Importing data from an external EXCEL-Sheet

I was assigned the task of copying some subsums from a given EXCEL-Sheet into the executing EXCEL-Sheet. This had to be done with an EXCEL-Macro, so non-programmers can easily use it. There was the ...
6
votes
2answers
196 views

Copy a contiguous sub-column of cells

This code searches for the word "Disbursements" and copies all of the rows with data below it, including the row with the specified word. After the rows are copied to a new sheet, the ...
6
votes
0answers
689 views

IndexedArray Class: Uses a Dictionary Keys to Index a 2 Dimensional Array of Values

This class encapsulates a 2D Array and a Scripting Dictionary. Values are add or returned from to the Array using a Key and a ColumnIndex, e.g. ...
5
votes
1answer
316 views

Managing Excel Tables (ListObjects) with OOP Approach

Objective: Manage what happens when users interact with Excel Tables (ListObjects) Possible interactions: Update an existing Excel table Add rows/columns to the table Update a cell or a range of ...
12
votes
3answers
661 views

Perf wrapper for Excel VBA

Spoiler This code is actually BAD for performances! So don't use it! ;) For a while now, I've been using this wrapper to avoid retyping most of it : ...
8
votes
1answer
168 views

A global Enum for comparison operators

This approach was born out of wanting to pass a logical expression (E.G. ">=10000") as a parameter to a function. So, I built an Enum and a function to use it to evaluate logical expressions. Is ...
7
votes
2answers
8k views

Traversing and printing complex Dictionary types (Scripting.Dictionary) - Dictionary inside of a Dictionary

Based on this SO post - also reposted on vba4all.com with a few more details and explanations. Please notice there currently is no error handling whatsoever as I didn't analyse and consider any traps ...
3
votes
3answers
5k views

Change filename of Excel-files based on the content of a cell

I have hundreds of Excel-sheets looking something like this: I can't use the actual sheet, and not the exact document numbers, since they are confidential. The name of the files are something like ...
2
votes
1answer
65 views

Making a report from payroll details part II

Thanks for the help so far! Especially all of the people who helped out on part I - seen here. Making a report from payroll details Here's the revisions to the code based on feedback from that thread....
8
votes
2answers
347 views

Making a report from payroll details

...
8
votes
3answers
325 views

If ComparisonIsTrue(thisPost, ComparisonOperator.NotEqualTo, goodCode) Then Me.Answer

This is a follow-on to a global enum for comparison operators. I wanted to pass a logical expression E.G. >= someValue as a parameter to a function, so I made an ...
3
votes
1answer
446 views

Managing Excel Tables (ListObjects) with OOP Approach (Follow up)

This is a follow up to this question Objective: Manage what happens when users interact with Excel Tables (ListObjects) Code incorporates: Greedo's answer suggestions: Listen to an encapsulated <...
3
votes
0answers
140 views

Looking for more efficient VBA to Move data from Teradata to Excel

I have a simple macro moving data from Teradata to Excel. The process normally takes me 10 minutes to perform manually, however the macro can run for hours sometimes. This is making the macro seems ...
3
votes
1answer
204 views

VBA syntax that compiles sub data into master sheet

I am using this syntax to bring in the names of all employees whom are active, then from there filter the data on subsequent worksheets and use a formula to bring the data over to the ...
3
votes
0answers
99 views

Comb Sort Multi-dimensional Array on Key

Previously: Comb Sort in VBA I've been running two different comb sorts (on arrays) depending on whether I want to sort numbers or strings and I figured I would give using ...
3
votes
2answers
355 views

Retrieve, total and display ingredients of meal

Here is the first iteration of this project on CodeReview Note: The input meal is data verified - it cannot be something that doesn't exist on the lookup sheet. ...
1
vote
1answer
152 views

Looping through with varied subtotal ranges

I've got an issue where my looping through the rows on my sheet are extremely slow. For 20,000 rows, it takes about 20 minutes, whereas before, it was taking 3. The only pieces I added were at the ...
1
vote
0answers
56 views

ContactEditor - Excel VBA db app: Storage Library

ContactEditor uses Excel VBA as a prototyping platform for a personal information manager combining the "Model, View, Presenter" (MVP) pattern and a persistent storage manager. Fig. 1. Data ...
1
vote
1answer
86 views

Changing the formatting of sheets

This my program to change the formatting of sheets in different folders. I have over 5000 files in one folder and it is taking up to three hrs for one folder and there are multiple subfolders in the ...
12
votes
3answers
5k views

Parameterised Constructors

Finally, Parameterised Constructors are possible in VBA. Background: One rainy day, I came up with an idea: take a static class and expose one property as default (like it was done in the Reverse for ...
13
votes
1answer
669 views

Tick. Tick. *breathe* BOOM! - Setting up real, stable asynchronous callbacks with WinAPI Timers in VBA

WinAPI Timers can be quite tricky to work with, as anyone who's tried to use them and fallen foul of one of the many pitfalls probably knows. Problems such as screen freezing, crashes, uncontrolled ...
8
votes
1answer
1k views

Space Invader Style Game Written In VBA

EDIT: Link to the github, https://github.com/Evanml2030/Excel-SpaceInvader THE README (APPLIES HERE TOO): VBA version of a classic game Yes, I know that "Missile" is repeatedly written as "Missle"...
11
votes
1answer
710 views

Standard Methods in VBA [closed]

Since I learnt about refactoring, I've been busy creating my own Module of Standard Methods. I feel it's about time they got a review of their own. Open to all aspects of advice but particularly ...
14
votes
1answer
115k views

Reading data from Excel sheet with ExcelDataReader

Objective: I want to import an Excel file, and read the rows of certain columns. For this, I use ExcelDataReader. I've implemented a low-level class called ...
7
votes
2answers
482 views

Excel display driver class for Tetris

This is the first of (hopefully) several posts as I reimplement an ancient (and unfortunately long lost) Excel VBA Tetris clone. The main workhorse class in the game engine is the display driver, ...
5
votes
0answers
1k views

Multithreaded Excel + VBScript Timer: Snake Game Demo

Multithreaded Excel + VBScript Timer After reviewing these post: Snake in Excel in… VBA? and Drawing a snake using arrow keys in Excel using VBA, I decided to work on creating a VBA Timer. The ...
10
votes
1answer
329 views

Produce a Linear Cut List for Woodworking

I was inspired to write this by a recent review of cutting pipes. The only thing I'm really iffy about is using the WriteCuts method. I couldn't figure out a way to ...
9
votes
2answers
1k views

Text file to spreadsheet

Lets say you have several .txt files in a folder and want to merge all text files into a single Excel document: A.txt ...
7
votes
2answers
105 views

VBA macro - searches through a filtered table, stops when entry passes criteria

I have written several subs which are then called from a main sub. Individual subs run very quickly, most are instantaneous (the DoFind sub takes a few seconds to run due to the large amounts of data ...
6
votes
1answer
57k views

Excel VBA - Get Folder Names

I need to get folder names with the path for which I need to search the directory in a server with about 6000 folders. I have the following snippet of code to run through the folder and get the folder ...
21
votes
1answer
23k views

Snake in Excel in... VBA?

snake-game is a game where you control a snake in an enclosed square without running into the walls or your own body. The snake grows when you run into whatever item you are supposed to run into. My ...
11
votes
1answer
628 views

Copy, Paste And Format

I am currently working with this code to automate some tasks for senior staff members that are not very adept in Excel. Wondering if VBA is simply not a very quick code or if my code is clunky and ...
10
votes
2answers
402 views

Financial Data From Webqueries in Excel

I'm new (to CR and to programming in general). I wrote my first VBA on Monday. This is my first working project. It Takes a bunch of financial data from a company called Financial Analytics and a ...
8
votes
2answers
3k views

Converting Data in Rows and Columns to Rows in VBA for Excel

I have a working VBA script for Excel that converts a matrix of data with multiple records in per row to multiple rows with one record per row. A StackOverflow user told me that the code could use ...
7
votes
3answers
2k views

Retrieve value from a formula in cells into different merged cells and retrieved value can be edited

I have created this macro and having a small issue. I am very new to this VBA and did this with experts’ guides by googling it. I am creating an excel form for a work purpose at work. The Excel form ...
5
votes
1answer
230 views

Migrating data from multiple spreadsheets to multiple text files

This is like the reverse functionality of Text file to spreadsheet. One or multiple .xlsx files in the path of the script get opened and the content is split into ...
5
votes
2answers
4k views

Dijkstra's algorithm implemented in Excel VBA

I wanted to implement Dijkstra's Algorithm in an Excel VBA Add-In and built it to be used as follows: Define a list of paths with distances between points. This list needs to contain 3 headings that ...
4
votes
2answers
224 views

Pick a folder and consolidate workbooks

I'm trying to create a simple way for current & future (non VBA literate) employees to accomplish some of the tasks I've struggled with. The first being Parsing cells containing Line Feed ...
4
votes
0answers
1k views

Using Excel Cell StyleElements to Style HTML Document

CellStyleCSS class creates css based of Excel Workbook CellStyles. This class is used in conjunction with TagBuilder class, ...
3
votes
1answer
79 views

Create Table After Deleting Rows Before Desired Range and Filter to Delete All Other Unnecessary Rows

The code below first searches for the first searchText and deletes all rows that precede it to establish a range for a table object. Once the table object is ...
3
votes
2answers
3k views

Populating a ComboBox from a Range

I recently had quite a lot of fun answering a Stack Overflow question, and I think I've gone a bit overboard and ended up with a fairly decent way of populating a ...