View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JH JH is offline
external usenet poster
 
Posts: 64
Default shorten value in a cell

thank you

JH



"cmart02" wrote:

You can run your test like this:

Sub test()

If Len(Range("A1")) 31 Then
supplierName = Mid(Range("A1"), 1, 31)
Else
supplierName = Range("A1")
End If

Then, for you sheet name, simply use the variable "supplierName".

Regards,
Robert
End Sub