PC Review


Reply
Thread Tools Rate Thread

Macro: How to create a new excefile - named as given in a cell-value

 
 
Snoopy
Guest
Posts: n/a
 
      16th Sep 2008
Hey guys
You have given me a helping hand on severel occassions, and I hope you
will do it again.

In my excel-file (exmpl): UserWorkBook.xls the UserID is specified in
cell A1 - Exmpl cellvalue A1 is "USER001"
When updating this UserWorkBook.xls I want the macro to create a
backup file - named as USER001BACKUP.xls and savet into a given folder
- expml: USERBACKUP.
The macro only copys all values and formats from
[UserWorkBook.xls]Sheet1! into this backup-file.
If the file USER001BACKUP.xls allready exists - this earlier versjon
should be deleted before saving the new one - or just revise the file
without any visible messages. (I dont knoe whats the easyest way.)

I would be happy if any of you could be nice and spend some minutes on
this one.

Regards Snoopy

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      16th Sep 2008
Activeworkbook.SaveCopyAs "USERBACKUP\" & Range("A1").Value

--
__________________________________
HTH

Bob

"Snoopy" <(E-Mail Removed)> wrote in message
news:91d056a0-c2ee-4640-afcb-(E-Mail Removed)...
> Hey guys
> You have given me a helping hand on severel occassions, and I hope you
> will do it again.
>
> In my excel-file (exmpl): UserWorkBook.xls the UserID is specified in
> cell A1 - Exmpl cellvalue A1 is "USER001"
> When updating this UserWorkBook.xls I want the macro to create a
> backup file - named as USER001BACKUP.xls and savet into a given folder
> - expml: USERBACKUP.
> The macro only copys all values and formats from
> [UserWorkBook.xls]Sheet1! into this backup-file.
> If the file USER001BACKUP.xls allready exists - this earlier versjon
> should be deleted before saving the new one - or just revise the file
> without any visible messages. (I dont knoe whats the easyest way.)
>
> I would be happy if any of you could be nice and spend some minutes on
> this one.
>
> Regards Snoopy
>



 
Reply With Quote
 
 
 
 
Snoopy
Guest
Posts: n/a
 
      16th Sep 2008
On 16 Sep, 11:20, "Bob Phillips" <Bob...@somewhere.com> wrote:
> Activeworkbook.SaveCopyAs "USERBACKUP\" & Range("A1").Value
>
> --
> __________________________________
> HTH
>
> Bob
>
> "Snoopy" <blak...@jjuc.no> wrote in message
>
> news:91d056a0-c2ee-4640-afcb-(E-Mail Removed)...
>
>
>
> > Hey guys
> > You have given me a helping hand on severel occassions, and I hope you
> > will do it again.

>
> > In my excel-file (exmpl): UserWorkBook.xls the UserID is specified in
> > cell A1 - Exmpl cellvalue A1 is "USER001"
> > When updating this UserWorkBook.xls I want the macro to create a
> > backup file - named as USER001BACKUP.xls and savet into a given folder
> > - expml: USERBACKUP.
> > The macro only copys all values and formats from
> > [UserWorkBook.xls]Sheet1! into this backup-file.
> > If the file USER001BACKUP.xls *allready exists - this earlier versjon
> > should be deleted before saving the new one - or just revise the file
> > without any visible messages. (I dont knoe whats the easyest way.)

>
> > I would be happy if any of you could be nice and spend some minutes on
> > this one.

>
> > Regards Snoopy– Skjul sitert tekst –

>
> – Vis sitert tekst –


Bob
Thanks a lot ))
One more question (if I may):
Activeworkbook.SaveCopyAs "USERBACKUP\" & Range("A1").Value copies the
entire sheet (exactly as I asked) , but I was not very accurat in my
describtion of the problem: I just want the values copied - not the
buttons and macrios plased in the UserWorkBook.xls Sheet1

Are there a similar elegant comand for this as well?

Regards
Snoopy
 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      16th Sep 2008
No, You would have to save it, open it again, paste values, save it and
close it.

--
__________________________________
HTH

Bob

"Snoopy" <(E-Mail Removed)> wrote in message
news:3c284b29-5a09-4e65-896c-(E-Mail Removed)...
On 16 Sep, 11:20, "Bob Phillips" <Bob...@somewhere.com> wrote:
> Activeworkbook.SaveCopyAs "USERBACKUP\" & Range("A1").Value
>
> --
> __________________________________
> HTH
>
> Bob
>
> "Snoopy" <blak...@jjuc.no> wrote in message
>
> news:91d056a0-c2ee-4640-afcb-(E-Mail Removed)...
>
>
>
> > Hey guys
> > You have given me a helping hand on severel occassions, and I hope you
> > will do it again.

>
> > In my excel-file (exmpl): UserWorkBook.xls the UserID is specified in
> > cell A1 - Exmpl cellvalue A1 is "USER001"
> > When updating this UserWorkBook.xls I want the macro to create a
> > backup file - named as USER001BACKUP.xls and savet into a given folder
> > - expml: USERBACKUP.
> > The macro only copys all values and formats from
> > [UserWorkBook.xls]Sheet1! into this backup-file.
> > If the file USER001BACKUP.xls allready exists - this earlier versjon
> > should be deleted before saving the new one - or just revise the file
> > without any visible messages. (I dont knoe whats the easyest way.)

>
> > I would be happy if any of you could be nice and spend some minutes on
> > this one.

>
> > Regards Snoopy– Skjul sitert tekst –

>
> – Vis sitert tekst –


Bob
Thanks a lot ))
One more question (if I may):
Activeworkbook.SaveCopyAs "USERBACKUP\" & Range("A1").Value copies the
entire sheet (exactly as I asked) , but I was not very accurat in my
describtion of the problem: I just want the values copied - not the
buttons and macrios plased in the UserWorkBook.xls Sheet1

Are there a similar elegant comand for this as well?

Regards
Snoopy


 
Reply With Quote
 
Snoopy
Guest
Posts: n/a
 
      17th Sep 2008
On 16 Sep, 15:54, "Bob Phillips" <Bob...@somewhere.com> wrote:
> No, You would have to save it, open it again, paste values, save it and
> close it.
>
> --
> __________________________________
> HTH
>
> Bob
>
> "Snoopy" <blak...@jjuc.no> wrote in message
>
> news:3c284b29-5a09-4e65-896c-(E-Mail Removed)...
> On 16 Sep, 11:20, "Bob Phillips" <Bob...@somewhere.com> wrote:
>
>
>
>
>
> > Activeworkbook.SaveCopyAs "USERBACKUP\" & Range("A1").Value

>
> > --
> > __________________________________
> > HTH

>
> > Bob

>
> > "Snoopy" <blak...@jjuc.no> wrote in message

>
> >news:91d056a0-c2ee-4640-afcb-(E-Mail Removed)....

>
> > > Hey guys
> > > You have given me a helping hand on severel occassions, and I hope you
> > > will do it again.

>
> > > In my excel-file (exmpl): UserWorkBook.xls the UserID is specified in
> > > cell A1 - Exmpl cellvalue A1 is "USER001"
> > > When updating this UserWorkBook.xls I want the macro to create a
> > > backup file - named as USER001BACKUP.xls and savet into a given folder
> > > - expml: USERBACKUP.
> > > The macro only copys all values and formats from
> > > [UserWorkBook.xls]Sheet1! into this backup-file.
> > > If the file USER001BACKUP.xls allready exists - this earlier versjon
> > > should be deleted before saving the new one - or just revise the file
> > > without any visible messages. (I dont knoe whats the easyest way.)

>
> > > I would be happy if any of you could be nice and spend some minutes on
> > > this one.

>
> > > Regards Snoopy– Skjul sitert tekst –

>
> > – Vis sitert tekst –

>
> Bob
> Thanks a lot ))
> One more question (if I may):
> Activeworkbook.SaveCopyAs "USERBACKUP\" & Range("A1").Value copies the
> entire sheet (exactly as I asked) , but I was not very accurat in my
> describtion of the problem: I just want the values copied - not the
> buttons and macrios plased in the UserWorkBook.xls Sheet1
>
> Are there a similar elegant comand for this as well?
>
> Regards
> Snoopy– Skjul sitert tekst –
>
> – Vis sitert tekst –


Thanks again Bob
It works now - big suprise!!!

Regards Snoopy
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sum for given date range for given item - can't find this for the life of me Finny Microsoft Excel Programming 3 30th Nov 2006 12:31 AM
How to return the Number of shares for a given stock code for a given portfolio aray Microsoft Excel Misc 1 18th May 2006 04:50 AM
how to test if a given ctype is of a given template? Lloyd Dupont Microsoft Dot NET Framework 1 19th Nov 2005 05:08 AM
how to test if a given ctype is of a given template? Lloyd Dupont Microsoft Dot NET 1 19th Nov 2005 05:08 AM
Finding people born in a given month or after a given year =?Utf-8?B?V2F0ZXJjb2xvciBhcnRpc3Q=?= Microsoft Excel Worksheet Functions 1 19th Sep 2005 05:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:17 PM.