Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel- How to copy values for each row using a macro? 1

Status
Not open for further replies.

scra

Technical User
Dec 7, 2001
55
0
0
US
Hello. I have a flat file in Excel. There are missing values on each row when value changes. I need to copy those values to each row. I'm not sure if I'm making any sense, but here is an example.

Current Output
Ticket # Patient Date of Service
1712612 111111 9/15/2011
null null 9/15/2011
null null 9/15/2011
1748292 222222 9/21/2011
null null 9/21/2011
null null 9/21/2011
null null 9/21/2011


Desired Output
Ticket # Patient # Date of Service
1712612 111111 9/15/2011
1712612 111111 9/15/2011
1712612 111111 9/15/2011
1748292 222222 9/21/2011
1748292 222222 9/21/2011
1748292 222222 9/21/2011
1748292 222222 9/21/2011
 
hi,

This can easily be done with a formula, for instance in column D
[tt]
D2: =if(isblank(a2),d1,a2)
[tt]
copy this DOWN column c thru all rows containing data.
copy column c to column d.

Now you have 2 fully populated columns.

copy columns c&d
select A1 and Edit > paste special -- VALUES.

now you have hard data in all rows in columns a & b

Delete columns c & d.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
oops. Seems I got confused with column c. All the formulas are in D & E, NOT column C.

Sorry [blush]

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top