View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_5_] Jim Thomlinson[_5_] is offline
external usenet poster
 
Posts: 486
Default Passing Variable length Space Characters to Variables

There is a function called string which takes two arguments. The number of
charachters and the character to repeat.

dim myString as String

myString = String(3, "-")
msgbox myString 'Shows 3 dashes

Just as a note I have always disliked the fact that String is both a data
type and a function. Who thought of that...
--
HTH...

Jim Thomlinson


"ExcelMonkey" wrote:

How do you pass variable length space to a variable. If I want to pass a
space cwith three spaces, I can do it manually by going:

Var = "---" (dashes representing spaces)

But what if the space width is variable in length? In this example I need
to pass the number three to a variable and then use this to define the space
between my quotes that get passed to my Var.

Thanks