replace question.

1. Senior Member
Join Date
Dec 1969
Posts
333

## replace question.

I want a way to look for any number over 6 digets and replace it any one got any ideas.

2. Senior Member
Join Date
Dec 1969
Posts
2,334

## use LEN

If len(Yournumber) &#062; 6 Then<BR>DO REPLACE <BR>End If

3. Senior Member
Join Date
Dec 1969
Posts
2,809

## RE: replace question.

If isNumeric(intNumber) & len(intNumber) &#062; 6 Then<BR> &#039;replace it<BR>else<BR> &#039;not over 6 or not a number<BR>end if<BR><BR>IsNumeric isn&#039;t perfect, but it&#039;ll get you started.

4. Senior Member
Join Date
Dec 1969
Posts
2,809

## Holy crap..

I&#039;m retarded<BR><BR>If isNumeric(intNumber) AND len(intNumber) &#062; 6 Then<BR>&#039;replace it<BR>else<BR>&#039;not over 6 or not a number<BR>end if<BR>

5. Senior Member
Join Date
Dec 1969
Posts
1,913

## RE: replace question.

If IsNumeric(MyVar) And Len(MyVar) = 6 Then<BR> MyVar = MyNewNumber<BR>End If

6. Senior Member
Join Date
Dec 1969
Posts
1,913

## Heh

I am too :(

7. Senior Member
Join Date
Dec 1969
Posts
333

## Almost there

What about if the number is part of a larger string and could contain more than one number

8. Senior Member
Join Date
Dec 1969
Posts
1,913

## Well you could have said

Try split() to turn the string into an array and then loop through the array replacing the &#062;6 digit numbers before putting it all back together again.

9. Senior Member
Join Date
Dec 1969
Posts
11,334

## Using Len() on a number returns byte size

So I dunno if that&#039;ll work unless he has it converted to a string... no?<BR><BR>I already forget what the poster posted... this is what&#039;s wrong with Hungarian Notation!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•