Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Add sheet and rename with cell contents

Here's what I'm trying to do:

We pull some server data using a VBS script, which is
then placed in a .csv file. To make things easier on the
non-excel users, I want ot automate putting the data in
the workbook. So my goal is to have a macro that they run
that does the following:

Inserts new sheet
Imports data from the file
Adds a column
Creates a new formula and pastes it down through the
column
Defines a few names in the sheet
Places the current date in a cell
Date is replaced as a value so it doesn't change
Use date value as sheet name.

I'm good to go all the way down to the last part "Use
date value as sheet name". So if the date value ends up
in J1, how can I get that value as the sheet name?

Thanks a bunch,

Rudy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Add sheet and rename with cell contents

Rudy



Use the date format that Matches your needs

ActiveSheet.Name = Format(Range("J1").Value, "YYMMDD")

or


ActiveSheet.Name = "Abc " & Format(Range("J1").Value, "YYMMDD")


---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Add sheet and rename with cell contents

It seems that you can name the sheet according to date and not to some cell
content - see below
We pull some server data using a VBS script, which is
then placed in a .csv file. To make things easier on the
non-excel users, I want ot automate putting the data in
the workbook. So my goal is to have a macro that they run
that does the following:

Inserts new sheet
Imports data from the file
Adds a column
Creates a new formula and pastes it down through the
column
Defines a few names in the sheet
Places the current date in a cell 'so you know it's a date, you know

its value...so
ActiveSheet.Name = Left(Date,10) ' or other format as Mudraker points
out
Date is replaced as a value so it doesn't change
[cut Use date value as sheet name.]

I'm good to go all the way down to the last part "Use
date value as sheet name". So if the date value ends up
in J1, how can I get that value as the sheet name?

Thanks a bunch,

Rudy



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Add sheet and rename with cell contents

Hi Rudy,
For sheet names, you must avoid certain characters like / and ,
(comma). So you must format the date correctly.

ActiveSheet.Name = Format(Range("A1").Value, "dd mmm yyyy")

Note that formatting the date in the cell and then using

ActiveSheet.Name = Range("A1").Value

will not work as it will lift the date value in mm/dd/yyyy format (it
did on my machine), which then generates an error.

regards
Paul

"Rudy Woltner" wrote in message ...
Here's what I'm trying to do:

We pull some server data using a VBS script, which is
then placed in a .csv file. To make things easier on the
non-excel users, I want ot automate putting the data in
the workbook. So my goal is to have a macro that they run
that does the following:

Inserts new sheet
Imports data from the file
Adds a column
Creates a new formula and pastes it down through the
column
Defines a few names in the sheet
Places the current date in a cell
Date is replaced as a value so it doesn't change
Use date value as sheet name.

I'm good to go all the way down to the last part "Use
date value as sheet name". So if the date value ends up
in J1, how can I get that value as the sheet name?

Thanks a bunch,

Rudy

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default THANKS

THANKS for the quick responses. I had tried several
combinations that were very similar to your solutions.
Now I can finish this projet today.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rename tab to cell contents Pierre Excel Worksheet Functions 3 February 10th 09 06:08 PM
rename worksheet based on contents of a cell in different workshee OfficeNDN Excel Discussion (Misc queries) 1 May 18th 07 06:02 AM
Rename Multiple Excel Workbooks based on cell contents Scott Campbell[_2_] Excel Discussion (Misc queries) 4 April 24th 07 10:00 PM
new worksheet and rename from cell contents macro Henry Excel Worksheet Functions 1 September 12th 06 10:35 AM
How do I automatically rename a sheet with the contents of a cell. michaelspearin Excel Discussion (Misc queries) 3 December 3rd 04 10:27 PM


All times are GMT +1. The time now is 10:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"