Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Comparing List A to List B and add what's missing from List B | Excel Discussion (Misc queries) | |||
create new list from list A, but with exclusions from a list B | Excel Worksheet Functions | |||
validation list--list depends on the selection of first list | New Users to Excel | |||
list 1 has 400 names List 2 has 4000. find manes from list 1 on 2 | Excel Worksheet Functions | |||
find names on list 1 in list 2. list 1 4000 names list 2 400 name | Excel Worksheet Functions |