2

I have a xls with some data, which i need to correct. For example: fix common typos, replace '4 parts' with 'four parts' etc.

Replacement rules are big key=>value arrays. So i just loop through them and do replacements.

I'd like to store those rules in single .yml files and load them in arrays as soon as my macro starts. I think it's easiest way to maintain them, because they are updated frequently. Unfortunately, vba seems to not have yaml parser.

Is there another way to keep my configuration beyond the macro?

Community
  • 1
  • 1
Stanislav
  • 2,683
  • 2
  • 18
  • 14

1 Answers1

1

Your Macro can be housed in another spreadsheet that is called to run on your target spreadsheet. So storing your rules in the Macros spreadsheet is possible. Editing the rules may not be as easy later, I kinda loath doing multi-line typing in Excel, but if you need a quick accessible data store it works.

Edit: And in reading your question again I see that you want to store this separate of the Macro. You could try json:

Is There a JSON Parser for VB6 / VBA?

Community
  • 1
  • 1
Dan Blair
  • 2,399
  • 3
  • 21
  • 32
  • Oh yeah! I put rules inside macro sheet and it's what i was looking for. Fortunately, there is ThisWorkbook property, which allows read-only access to macro sheet inside another Excel instance. – Stanislav Dec 13 '12 at 07:12