Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Assign Formula to Variable

I am sure this is simple but I can't figure our where I am going wrong, here is what I have

Length = Len(" & FileNumber4 & "

I am trying to assign to the variable named "Length" the number of characters in the variable named "FileNumber4

Where am I going wrong, I have looked around and I though this should work but the value for Length should end up as either a 5 or a 6 and it is telling me it is 17. I am a little lost

Thanks for the advice

Jim
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Assign Formula to Variable

James,

Try this

Length = Len(FileNumber4)


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"James Stephens" wrote in message
...
I am sure this is simple but I can't figure our where I am going wrong,

here is what I have.

Length = Len(" & FileNumber4 & ")

I am trying to assign to the variable named "Length" the number of

characters in the variable named "FileNumber4"

Where am I going wrong, I have looked around and I though this should work

but the value for Length should end up as either a 5 or a 6 and it is
telling me it is 17. I am a little lost.

Thanks for the advice,

Jim



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Assign Formula to Variable

Everything enclosed within a pair of double quotes is considered a
literal. So, you are getting the length of the literal string space-
ampersand-space-the-letters-that-spell-FileNumber4-space-ampersand-
space.

To get the length of the contents of FileNumber4 use Len(FileNumber4)

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
I am sure this is simple but I can't figure our where I am going wrong, here is what I have.

Length = Len(" & FileNumber4 & ")

I am trying to assign to the variable named "Length" the number of characters in the variable named "FileNumber4"

Where am I going wrong, I have looked around and I though this should work but the value for Length should end up as either a 5 or a 6 and it is telling me it is 17. I am a little lost.

Thanks for the advice,

Jim

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Assign Formula to Variable

Thanks guys, that took care of it. Sometimes its so simple you just can't figure it out

Thanks alot for the help

Ji

----- Tushar Mehta wrote: ----

Everything enclosed within a pair of double quotes is considered a
literal. So, you are getting the length of the literal string space
ampersand-space-the-letters-that-spell-FileNumber4-space-ampersand
space

To get the length of the contents of FileNumber4 use Len(FileNumber4

--
Regards

Tushar Meht
www.tushar-mehta.co
Excel, PowerPoint, and VBA add-ins, tutorial
Custom MS Office productivity solution

In article ,
says..
I am sure this is simple but I can't figure our where I am going wrong, here is what I have
Length = Len(" & FileNumber4 & "
I am trying to assign to the variable named "Length" the number of characters in the variable named "FileNumber4
Where am I going wrong, I have looked around and I though this should work but the value for Length should end up as either a 5 or a 6 and it is telling me it is 17. I am a little lost
Thanks for the advice
Ji


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
Assign value to a variable name Gnarlodious Excel Discussion (Misc queries) 2 August 20th 06 07:10 AM
Assign value to variable rroach Excel Discussion (Misc queries) 1 July 13th 05 05:24 AM
How do I assign a text value to a variable number of rows? Jday Excel Worksheet Functions 6 June 20th 05 01:46 PM
Variable VB to assign new sheet name Kevin M Excel Worksheet Functions 0 June 17th 05 12:15 AM
How can I assign a range starting cell based on a variable locati. feman007 Excel Discussion (Misc queries) 1 March 9th 05 11:41 PM


All times are GMT +1. The time now is 01:30 AM.

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"