Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Rename unknown sheet name in excel.

I am getting a file wherein the name of the worksheet is not unique and i am
finding it dffficult to rename through program.

Can anyone help me out to rename a worksheet which is named differently
every time and normally only one worksheet is found in workbook.

Thank you in advance
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Rename unknown sheet name in excel.

I think the problem is not explained to you correctly.

I process the file based on file received by me from our customers. In the
file, sheet is named differenly (depending upon client to client).

Hence, i need some solution, wherein i can rename the sheet name to sheet1.
In other words i would like to rename sheet to sheet1 (the original sheet
name may be vijay or March or Wednesday etc).

How to rename unknown sheet name through VBA program

"Nigel" wrote:

Use the sheet index, not the sheet name.

So refer to the sheet as..... Sheets(1)


--

Regards,
Nigel




"Vijay Kotian" wrote in message
...
I am getting a file wherein the name of the worksheet is not unique and i
am
finding it dffficult to rename through program.

Can anyone help me out to rename a worksheet which is named differently
every time and normally only one worksheet is found in workbook.

Thank you in advance


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Rename unknown sheet name in excel.

Dim CustomerWorkbook As Workbook
Dim Sheet As Worksheet

Set CustomerWorkbook = Workbooks.Open("Customer Workbook.xls")

' if the workbook only has one sheet then rename it else search each sheet
' for some kind of identifying mark such as a page title, etc.

If CustomerWorkbook.Worksheets.Count = 1 Then
CustomerWorkbook.Worksheets(1).Name = "Sheet1"
Else
For Each Sheet In CustomerWorkbook.Worksheets
If Sheet.Range("A1") = "Customer Data" Then
Sheet.Name = "Sheet1"
Exit For
End If
Next Sheet
End If


"Vijay Kotian" wrote:

I think the problem is not explained to you correctly.

I process the file based on file received by me from our customers. In the
file, sheet is named differenly (depending upon client to client).

Hence, i need some solution, wherein i can rename the sheet name to sheet1.
In other words i would like to rename sheet to sheet1 (the original sheet
name may be vijay or March or Wednesday etc).

How to rename unknown sheet name through VBA program

"Nigel" wrote:

Use the sheet index, not the sheet name.

So refer to the sheet as..... Sheets(1)


--

Regards,
Nigel




"Vijay Kotian" wrote in message
...
I am getting a file wherein the name of the worksheet is not unique and i
am
finding it dffficult to rename through program.

Can anyone help me out to rename a worksheet which is named differently
every time and normally only one worksheet is found in workbook.

Thank you in advance


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Rename unknown sheet name in excel.

I am happy enough writing macros but want some help to ensure I can
write the one I want!

I have a spreadsheet with pupil details in columns A-C, and then
currently in columns D-AA I hold marking details for student progress.

What I want to be able to do is each time a student's marks change, I
want to place the date in a helper column for the date of the most
recent change to the row. And what I really want is it to display
(maybe in another column) "Today" if it has changed today, "Week" if
it has changed in the last week, and "Month" if it has changed in the
last month. If over a month, then "Warning" needs to be displayed.

Any help gratefully received.

Noz
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
how do i rename a sheet if the rename tab is inactive? Nelson Excel Worksheet Functions 1 March 3rd 10 10:28 AM
Importing from Excel sheet with unknown name Soren[_2_] Excel Programming 1 January 30th 08 08:14 AM
rename unknown named files [email protected] Excel Programming 3 February 7th 07 03:15 AM
VBA to rename sheet WITHIN Excel DS Excel Programming 3 July 1st 05 03:30 PM
I cannot rename my excel sheet? Cissy Excel Worksheet Functions 1 April 3rd 05 05:50 AM


All times are GMT +1. The time now is 07:32 PM.

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"