View Single Post
  #37   Report Post  
Posted to microsoft.public.excel.programming
Dennis Dennis is offline
external usenet poster
 
Posts: 59
Default How in to parse constants in formula to cells

Intrigued by your code, I just said the hell with it and just
experimented. Then walla! I got to your answer at 2:15PM EST.

As you can tell, I am "new" to this. Even though I know the difference
between a constant and variable, I did not realize that Const was just
short for Constant begging Public & Private issues. I even thought it
was short for Construct what ever that is. Just making mountains out of
mole hills when 20/20 hindsight is available.

Thanks again

EagleOne



Ron Rosenfeld wrote:
On 30 Nov 2006 07:39:39 -0800, "Dennis" wrote:

I could not wait!

How do I handle:

Const NumToReplace = 2
Const ReplWith = 4

These need to be variables determined in subsequent code.

So do I:

Const NumToReplace As Double (needs "=" to something)
Const ReplWith As Double (needs "=" to something)

-or-

Dim NumToReplace as String (or Double or Long)
Dim NumToReplace as String (or Double or Long)

EagleOne


Well, I didn't know how you were planning to input those variables, so I just
put them in as Constants for testing purposes. You can Dim them and then set
them to whatever, however you wish.

With the Const statement, the type declaration is optional. But if the values
were always going to be integers, I would use the Long type; if they might be
decimal numbers, I would use Double or String.


--ron