Skip to main content

All Questions

Tagged with
43 votes
4 answers
14k views

A lightning-fast StringBuilder

In the process of trying to build a serializable data structure, I found myself building large strings, which gets very slow because VBA copies a string every time concatenation is performed. To ...
Blackhawk's user avatar
  • 1,134
20 votes
3 answers
3k views

A CSharpish String.Format formatting helper

A while ago I implemented .net's string.Format() method in VB6; it works amazingly well, but I'm sure there has to be a way to make it more efficient. I'll start ...
Mathieu Guindon's user avatar
12 votes
4 answers
2k views

Delete rows in spreadsheet where cells match some patterns

I have vba code that loops through a large number of records and deletes rows based on criteria. The issue at hand is that it takes far too long to run. I have never actually let it finish because it ...
PartyHatPanda's user avatar
12 votes
2 answers
25k views

String Repeat function in VBA

VBA has built-in functions for repeating a single character: Function String$(Number As Long, Character) As String ...
ThunderFrame's user avatar
  • 1,959
10 votes
3 answers
977 views

A more readable InStr: StringContains

Consider the following: If myString = "abc" Or myString = "def" [...] Or myString = "xyz" Then In C# when myString == "abc" ...
Mathieu Guindon's user avatar
9 votes
3 answers
1k views

Ugly workaround to get the vbext_ProcKind of a procedure is breaking encapsulation

This is a follow up to Extending the VBAExtensibility Library. It turns out that code had a really nasty bug. Anytime vbeProcedure.StartLine got called, I was ...
RubberDuck's user avatar
  • 30.8k
8 votes
1 answer
11k views

Representing Objects as strings in VBA

I am working an a more meaningful way to print objects in VBA. The desired result should look something like this. ...
cheezsteak's user avatar
  • 2,401
7 votes
4 answers
15k views

Hex encoding and decoding of ASCII strings in VBA

I needed to convert some Ascii text to binary in Hex format 0x00FF.... I've written an EncodeHex and a ...
ThunderFrame's user avatar
  • 1,959
7 votes
1 answer
230 views

A Moses's worthy string splitter

I am trying to perfect my string splitter's performance, to be more fast, more easy to maintain if someone else reads it and more readable code-wise. Context ,Scope and Objectives Where I work we ...
svacx's user avatar
  • 433
6 votes
2 answers
1k views

Next revision letter

This is a fun one! I wrote some code to automatically get the next revision letter for a file by looking at the existing letter. It works, but I think there is room for improvement as far as ...
CBRF23's user avatar
  • 409
6 votes
3 answers
204 views

Rubberduck Test Module Creation

I recently started learning C# and am taking the opportunity to try and accelerate my introduction by helping the RubberDuck team (Website and GitHub Repo). The full class code that I'm working on can ...
IvenBach's user avatar
  • 3,487
6 votes
1 answer
448 views

Fastest function to `Remove Duplicate Lines` per each cell

The below function is used to Remove Duplicate Lines per each cell. It works without problem, but it is slow with a range of only one column and 17k rows. Actually, ...
Leedo's user avatar
  • 275
6 votes
1 answer
505 views

Replace function in VBA

For reasons I'd rather like to not talk about, I am in a VBA environment that doesn't have the replace function (Access 97). I have wrote this to alleviate my frustrations. My question is, what is ...
Doug Coats's user avatar
5 votes
2 answers
1k views

Text files: Copy, Rename, Append/Merge together

I wrote 3 subroutines related to batch data processing, they will be used together. A bit of background, I wrote this for my admin colleagues who do not write code. An application dumps daily ...
Phrancis's user avatar
  • 20.4k
5 votes
1 answer
117 views

Similarity between words

I'm writing a method that writes the code for a loading routine. Given an object from the database, I want to put its properties in the right control on a userform. I have the list of the properties ...
DT1's user avatar
  • 354

15 30 50 per page