More Dynamic Excel King

Tips from Excel King

Make your macros more dynamic!

Today's tip is about how to easily create a macro that allows user select the Excel file / text file / ASCII file etc to be opened. You may also examples of how you can jump between multiple open files.
When you create macros that perform some more advanced operations, it is always good to think dynamically – ie how outset builds flexibility into your macros.

A clear advantage of this approach is that the Excel files as the macro import not need to have the same name on each run of the macro.

The procedure is as follows:

1. Take in the name of what file.
The method GETOPENFILENAME in VBA open dialog “Open File” or “Open File”. This box allows the user to easily point to a wise file.

2. Read in the name (path) in a variable.

3. Use variable to open file.

4. Carry it as desired with the file.

All of the above is managed via simple VBA code that you can easily include in your macros.

Maybe you get to experiment with the code a few times before you fully understand the procedure, but once you've learned the example, you will surely have a significant benefit in the future.

You can find the sample code in the section on GetOpenFilename on Excelkungen.com.

He is truly the king of Excel…Excel king..
Be Careful Out There
Anders

Supermåndag

That was the day for even a super Monday only.

The week that went were … I it was not fun to go back to work. Luckily it was relatively quiet this week and everything went pretty well after all. Would have liked to been on Zlatan Camp with Wilmis all week to and from but duty called.

The worst week was enough to be entered “lunken” again, into myrboet popularly known as the T-Central. Do not be pushed by all completely stressed Stockholmers. I do not understand the tempo they / we agree, they run all the time or go as if it was the last train to leave the station in an hour…there is one to three minutes…usually within two minutes…take it easy have the urge to scream.

Wilma had said was ZC and had glorious weather all week and enjoyed a fish in water. Good for her, good for us all in the family.

Training, or powerwalksen rolls on really well. Good with neighbors pushing each other and fun that we can run together out around the golf course climes.

Looking forward to this coming week when work escalates and procedures will hopefully begin to settle.

On Thursday it's back to school with new teachers Wilmis. Certainly exciting and a little worried because their previous head teacher was so good. Now they have a daughter starting middle school…very mixed feelings for me…do not want her to be older than this but it's so hard to follow the development. It will probably be fine in the end.

Now, Super Monday ends with football training and a power walk.

image

Be Careful out there
Anders

Västerbotten, East- and ham pie and chicken pie…

…I'll cook up Thursday at this year's crayfish party with colleagues…if that is ngn who succeed book a school kitchen on the island and buy all the ingredients for everything I have promised to cook
2 Each västerbotten pies, 2 Each cheese- and skinkpajer and 1 chicken pie.

My dream is fulfilled by being able to work in a newly built kitchen…on NGN manages to make it to me ,sv

Be Careful Out There
Anders