Thread: Adding zeros
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Adding zeros

Right("0000000" & Textbox1.Value, 7)

--
Regards,
Tom Ogilvy

"abxy " wrote in message
...
ok, i have a string of code in my userform that looks like this:

If Application.CountIf(ws.Cells.Range("A1:A275"), *"000" &
TextBox1.Value*) 0 Then

now, the thing is, i've discovered that saying 000 and textbox1.value
won't always give you the desired result, so, my question is, how can i
alter that line of code to say, textbox1.value and keep adding zeros in
front of it, until there are 7 digits?

thanks for helping me out :)


---
Message posted from http://www.ExcelForum.com/