View Single Post
  #36   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default How in to parse constants in formula to cells

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