Microsoft Excel Guru's out there?

A meeting area where members can relax, chill out and talk about anything non magical.


Moderators: nickj, Lady of Mystery, Mandrake, bananafish, support

Microsoft Excel Guru's out there?

Postby Magical_Trevor » Apr 3rd, '11, 17:09



Hey peeps,

Totally un-magic related here, but I'm having a few excel issues, any guru's will most likely be able to fix this within seconds - but its driving me mad

I have a template file, with a working macro which does X Y and Z, (Summary is that it copies lots of cells from a 2nd spreadsheet, pastes it into the template (or current open xls file) then close the 2nd spreadsheet).

The issue I have is that within the macro I use the following line:

Windows("QuoteTemplate.xls").Activate

which means that when I "SaveAs" and change the filename which contains the macro, I get an error because the macro tries to paste the files into the QuoteTemplate.xls, NOT the currently open (and renamed) xls file.

Is there a way to either change the above line to automatically replace it with the current filename [like Windows(this.worksheet).Activate] or when even maybe to change the line when I saveAs (so whatever I saveAs will replace the "QuoteTemplate.xls" with the name I use)

Any help would be much appreciated

Dan

User avatar
Magical_Trevor
Senior Member
 
Posts: 418
Joined: Aug 16th, '06, 18:03
Location: Kidderminster, UK

Return to The Dove's Head

Who is online

Users browsing this forum: No registered users and 36 guests