View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Rick[_19_] Rick[_19_] is offline
external usenet poster
 
Posts: 52
Default automatically fill up a cell?

I'm not sure what you mean...but I'm guessing that this is
what you may want.

Sub EightDigitsR1()
Dim A As Integer
Dim B As Byte

For A = 5 To 15
For B = 1 To 8
If Len(Cells(A, 5).Value) = B Then
Cells(A, 5).Value = "'" & _
String(8 - B, "0") & Cells(A, 5).Value
Else
Cells(A, 5).Value = "'" & Cells(A, 5).Value
End If
Next B
Next A

End Sub

-----Original Message-----
thnx, works great. Just one little question.
When i copy and paste it in macro, in the destination

file it shows
the original value. Is there a way to set the created

value to a fixed
value??


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

.