WHeisenburg
Programmer
I'm trying to write some code to loop through a field for every record in a table and perform some conversions. I'm new to VBA and could use some help.
Here's the process. It loops through field "Pin_A" and looks for entries where the format is a lowercase letter and then one number (e.g. 'c6' or 'a2' or 'b3' and so on). When it finds one it will prepend an underscore to the entry. (The new entries would be '_c6' or '_a2' or '_b3', etc.) It's important that it not change entries that have an uppercase letter (e.g. 'C6') or entries with two digits (e.g. b22).
If anyone could help me out it would be much appreciated. It doesn't seem like it would be too difficult but I'm very new to this and in over my head. Most examples I can find or using the replace function don't account for case. Thanks!
Here's the process. It loops through field "Pin_A" and looks for entries where the format is a lowercase letter and then one number (e.g. 'c6' or 'a2' or 'b3' and so on). When it finds one it will prepend an underscore to the entry. (The new entries would be '_c6' or '_a2' or '_b3', etc.) It's important that it not change entries that have an uppercase letter (e.g. 'C6') or entries with two digits (e.g. b22).
If anyone could help me out it would be much appreciated. It doesn't seem like it would be too difficult but I'm very new to this and in over my head. Most examples I can find or using the replace function don't account for case. Thanks!