All Questions
29
questions
0
votes
0
answers
46
views
Faster method to check if a string is found inside Word Files in a directory and subdirectories
I need to check if a string is found inside a Word File in a directory and subdirectories.
I have tried to use Advanced Search of MS Windows 10, to search inside ...
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" ...
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, ...
3
votes
1
answer
302
views
Create VBA string array fastest method
My VBA has become really rusty but I need it for now for some data downloading.
This routine works but I'm certain that over the last 10 (at least) years something quicker/less code has surfaced to do ...
4
votes
3
answers
474
views
Excel VBA code midStr() function using left and right position instead of length used with mid()
In the early days of Basic (1970's when i started coding) the midStr() function used left and right positions directly rather than left and length we now use with mid(). I always found it more ...
4
votes
2
answers
931
views
Excel VBA Code for Imperial Length Measure Conversion and Formatting Yards Feet and Inches for English and Spanish
STR2INCHES is an Excel VBA Function that will convert string text for Imperial length measurements to a decimal number of Inches.
It handles both English and Spanish words, abbreviations and symbols ...
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 ...
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 ...
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
...
1
vote
2
answers
51
views
Trimming strings in non-contiguous spreadsheet ranges
This code is tested and works, but I am needing some guidance on simplifying these loops with non-contiguous ranges. I was thinking an array might be better, but I ...
4
votes
1
answer
329
views
VBA Text Class, sort of like .NET
This is my first attempt at writing some reusable OOP code. The problem I'm trying to simplify is the confusing (at least to me) structure of VBA string manipulation.
Example
...
3
votes
1
answer
234
views
Safely and efficiently parse and replace tokens in a string
I have written a VBA function that will do parsing / replacement according to tokens / placeholders.
Example:
Input string: Username %u, date is %d.
The function ...
1
vote
3
answers
722
views
Excel VBA Retrieving a Specific Pattern from String
The following VBA code is in response to a SuperUser question which I found interesting.
What I'm looking for in a response?
Code cleanliness. Can I do more to make the code easier to read and ...
1
vote
1
answer
87
views
Transforming the case of text using Excel VBA
I created a simple user form for my VBA course.
I then created the following VBA code:
...
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 ...