ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Would a loop work? (https://www.excelbanter.com/excel-programming/308511-would-loop-work.html)

sixfivebeastman[_7_]

Would a loop work?
 
I have a list of SSNs (social security numbers) along with various line
of information that looks something like this:

123456789 , 1 , 64A , 114 , 75.11 , 1.7180
_________, 2 , 65A , 207 , 30.34 , 0.6050

Each of the commas represent a different cell.
In other words, the SSNs do not extend down for each line, and ther
are multiple lines for each SSN. This is quite an extensive list and
need the appropriate SSN to extend to each line that is associated wit
it so that it would look like this:

123456789 , 1 , 64A , 114 , 75.11 , 1.7180
123456789 , 2 , 65A , 207 , 30.34 , 0.6050

How would I write a macro to do this?
I've tried using a loop but it refused to work so I scrapped the entir
thing.
Any help would be greatly appreciated!!
ti

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


Tom Ogilvy

Would a loop work?
 

In code my suggestion would be:
Sub FillBanks()
Dim rng as Range
set rng = columns(1).specialCells(xlblanks)
rng.Formula = "=" & rng(1).offset(-1,0).address(0,0)
set rng = range(cells(1,1),cells(rows.count,1).End(xlup))
rng.Formula = rng.Value
End Sub

--
Regards,
Tom Ogilvy

"sixfivebeastman " wrote in
message ...
I have a list of SSNs (social security numbers) along with various lines
of information that looks something like this:

123456789 , 1 , 64A , 114 , 75.11 , 1.7180
_________, 2 , 65A , 207 , 30.34 , 0.6050

Each of the commas represent a different cell.
In other words, the SSNs do not extend down for each line, and there
are multiple lines for each SSN. This is quite an extensive list and I
need the appropriate SSN to extend to each line that is associated with
it so that it would look like this:

123456789 , 1 , 64A , 114 , 75.11 , 1.7180
123456789 , 2 , 65A , 207 , 30.34 , 0.6050

How would I write a macro to do this?
I've tried using a loop but it refused to work so I scrapped the entire
thing.
Any help would be greatly appreciated!!
tim


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





All times are GMT +1. The time now is 12:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com