View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Finding_Facts_NC[_2_] Finding_Facts_NC[_2_] is offline
external usenet poster
 
Posts: 3
Default Unsure what formula to use

Don, I'm not familiar with writing macros and uncertain how to proceed with
the code? It may very well work to resolve my problem, but I will need to
get more guidance on how to use it first. Thansk for the response!

"Don Guillett" wrote:

try this

Sub fixnums()
mycol = 4
For i = Cells(Rows.count, mycol).End(xlUp).Row To 2 Step -1
If Len(Cells(i, mycol)) = 4 Then
Cells(i, mycol + 1).Value = Cells(i, mycol)
Else
Cells(i, mycol + 1).Value = Cells(i + 1, mycol + 1)
End If
Next i
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Finding_Facts_NC" wrote in
message ...
I have a column containing three digit numbers and four digit numbers. I
need to replace the three digit numbers with the first four digit number
listed below them.
Here's an example of the numbers listed in column "B" and what the result
should look like in column "C"

A B C
Co Name 1 119 5530
Co Name 1 449 5530
Co Name 1 5530 5530
Co Name 2 119 5513
Co Name 2 5513 5513
Co Name 3 119 5540
Co Name 3 449 5540
Co Name 3 559 5540
Co Name 3 5540 5540

There are over 6,000 rows. Is there a formula that will help me do this?