Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default naming fields

Hello!

Excel does some crazy things, when I try to name fields.
In my code I copy a sheet, rename it, and then I name the fields. When I
start the macro, the sheet gets inserted, but the fields do not get named.
The crazy thing is, that when I step through the code with the debugger,
there is no problem, all fields get their name!
**********
Sheets("first_sheet").Copy Befo=Sheets("third_sheet")
Sheets("first_sheet (2)").Name = "second_sheet"
Application.CutCopyMode = False
ThisWorkbook.Names.Add Name:="my_number", RefersToR1C1:="=second_sheet!R1C1"
**********

What is the reason for this crazy behaviour? Hope somebody can help me.

Regars
Christian Galbavy



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default naming fields

Sub B()
Sheets(1).Name = "first_Sheet"
Sheets(2).Name = "third_sheet"
Sheets("first_sheet").Copy Befo=Sheets("third_sheet")
Sheets("first_sheet (2)").Name = "second_sheet"
Application.CutCopyMode = False
ThisWorkbook.Names.Add Name:="my_number", _
RefersToR1C1:="=second_sheet!R1C1"
MsgBox ThisWorkbook.Names("my_Number"). _
RefersToRange.Address(external:=True)
End Sub

in a general module worked fine for me.

--
Regards,
Tom Ogilvy

"Christian Galbavy" wrote in message
...
Hello!

Excel does some crazy things, when I try to name fields.
In my code I copy a sheet, rename it, and then I name the fields. When I
start the macro, the sheet gets inserted, but the fields do not get named.
The crazy thing is, that when I step through the code with the debugger,
there is no problem, all fields get their name!
**********
Sheets("first_sheet").Copy Befo=Sheets("third_sheet")
Sheets("first_sheet (2)").Name = "second_sheet"
Application.CutCopyMode = False
ThisWorkbook.Names.Add Name:="my_number",

RefersToR1C1:="=second_sheet!R1C1"
**********

What is the reason for this crazy behaviour? Hope somebody can help me.

Regars
Christian Galbavy





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
fields names do not show in excel 2007 pivot table fields list marlo17 New Users to Excel 2 December 1st 08 01:25 PM
Excel SHOULD NOT AUTO-CHANGE formated text fields to DATE FIELDS! PSSSD Excel Worksheet Functions 2 August 8th 06 09:31 PM
Catalogue of fields' connection whit external fields ( sheets) Nicola Excel Programming 0 September 27th 03 10:51 AM
Catalogue of fields' connection whit external fields ( sheets) nicola Excel Programming 0 September 27th 03 10:43 AM
Catalogue of fields' connection whit external fields ( sheets) Nicola Bianchi Excel Programming 0 September 27th 03 10:42 AM


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

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

About Us

"It's about Microsoft Excel"