Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to name the list


Hello guys
I need help. I am trying to write my first VBA code. First complicatio
has already occured :-).
I want to name the list after cell, including cellīs forma
(00"/"0000"/"00)

I use this simple code but doesnīt work properly:

Private Sub CommandButton2_Click()
ActiveSheet.Name = ActiveSheet.Range("B1").Value
End Sub



For instance: The cell has content : 05/4103/01 and I need to get thi
into Listīs name field.

My procedure returns only 5410301 as a List name


Thank you for your advice

--
Toma
-----------------------------------------------------------------------
Toman's Profile: http://www.excelforum.com/member.php...fo&userid=3139
View this thread: http://www.excelforum.com/showthread.php?threadid=51479

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to name the list

Hi Toman

The slash (/) is not a legal sheet name character.

Changing the slash for (say) a hyphen, your code worked for me.


---
Regards,
Norman


"Toman" wrote in
message ...

Hello guys
I need help. I am trying to write my first VBA code. First complication
has already occured :-).
I want to name the list after cell, including cellīs format
(00"/"0000"/"00)

I use this simple code but doesnīt work properly:

Private Sub CommandButton2_Click()
ActiveSheet.Name = ActiveSheet.Range("B1").Value
End Sub



For instance: The cell has content : 05/4103/01 and I need to get this
into Listīs name field.

My procedure returns only 5410301 as a List name


Thank you for your advices


--
Toman
------------------------------------------------------------------------
Toman's Profile:
http://www.excelforum.com/member.php...o&userid=31397
View this thread: http://www.excelforum.com/showthread...hreadid=514795



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to name the list

Hi Toman,

Changing the slash for (say) a hyphen, your code worked for me.


Or, more explicitly:

ActiveSheet.Name = _
Format(ActiveSheet.Range("B1").Value, "00-0000-00")


---
Regards,
Norman


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to name the list


Thank you guys.
Now it is working perfectly;)


--
Toman
------------------------------------------------------------------------
Toman's Profile: http://www.excelforum.com/member.php...o&userid=31397
View this thread: http://www.excelforum.com/showthread...hreadid=514795

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
Comparing List A to List B and add what's missing from List B Gilbert Excel Discussion (Misc queries) 2 July 20th 09 11:18 PM
create new list from list A, but with exclusions from a list B Harold Good Excel Worksheet Functions 3 April 11th 08 11:23 PM
validation list--list depends on the selection of first list Michael New Users to Excel 2 April 27th 06 10:23 PM
list 1 has 400 names List 2 has 4000. find manes from list 1 on 2 Ed Excel Worksheet Functions 5 September 12th 05 09:48 AM
find names on list 1 in list 2. list 1 4000 names list 2 400 name Ed Excel Worksheet Functions 1 September 4th 05 12:48 AM


All times are GMT +1. The time now is 01:15 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"