PDA

View Full Version : Solved: Name (too long)



Pinokkio
03-24-2010, 12:04 PM
Hi, good nigth.

H1 = "Amdez-16-03-2010-184813"

Set wks = ActiveSheet
Do While sName <> wks.Name
sName = ActiveSheet.Range("H1")
On Error Resume Next
wks.Name = sName
Loop
Set wks = Nothing

Here is a listing that works with de name "Amdez" or "Amber" ...
But wen I thake the name
"Andreas Kuiper BV-16-03-2010-184813"
I get the ERROR on line "Loop"

Is there anyone who can help.

SamT
03-24-2010, 12:17 PM
Try:

sName = ActiveSheet.Range("H1").Value

If Value doesn't work try "Text" "Formula" or "Value2."

mdmackillop
03-24-2010, 12:20 PM
It appears 31 characters is the maximum length for a sheet name (Excel 2003)

SamT
03-24-2010, 12:21 PM
Ah

Pinokkio
03-24-2010, 12:54 PM
@SamT,
Dos not work.

@mdmackillop

It appears 31 characters is the maximum length for a sheet name (Excel 2003)
Is this for xl2007 to?

I work with xl2007.

ANDREAS KUIWA-24-03-2010-204831 / This I can save.
ANDREAS KUIWAG-24-03-2010-204831 / This I can NOT save.

Thanks for info.

mdmackillop
03-24-2010, 01:15 PM
Try this macro

Sub TestLength()
On Error Resume Next
Set wks = ActiveSheet
For i = 0 To 50
txt = txt & "a"
ActiveSheet.Name = txt
Next
MsgBox Len(ActiveSheet.Name)
End Sub

Pinokkio
03-24-2010, 02:16 PM
Yes, xl2007 also 31 characters.

Tanks very much.