View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Worksheet as file

Dim sh as Worksheet, sh1 as Worksheet
set sh = workbooks("AAA.xls").Worksheets("Baza")
sh.copy
set sh1 = Activesheet
Call xxx
sh1.parent.SaveAs Filename:=sh.parent.Path & "\Name" & _
sh1.Range("A1").Text & ".xls", Fileformat:=xlNormal
Sh1.parent.Close SaveChanges:=False
sh.Range("B1").Value = clng(sh.Range("B1").Value) + 1
sh.Parent.Close SaveChanges:=True


--
Regards,
Tom Ogilvy


"C3" wrote in message
...
Hi!

First, I have a .xls file (AAA.xls) with a single (base) worksheet
("Baza") - content of one cell (B1) is "0001". I want to copy this

worksheet
(because I want to save data unchanged in base worksheet) and run macro
(etc."xxx") who will take some changes, save this "changed" worksheet as a
.xls file in format "Name0001.xls" and erase that "changed" worksheet. For
next time when I'll open AAA.xls cell (B1) must grow for one number (0002)
and next saved file must have this number "Name0002.xls" and so on...

Any suggestions?

C3