Thread: Hierarchy Macro
View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Hierarchy Macro

Now that's slick. I wish I had thought of that.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"Dana DeLouis" wrote in message
...
If the cells to the right of your table is clear, maybe:

Sub Demo()
With [A1:H8]
.SpecialCells(xlCellTypeBlanks).Delete (xlToLeft)
.SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=RC[-1]"
.Value = .Value
End With
End Sub

--
Dana DeLouis
Windows XP & Excel 2007


"Jason Hall" wrote in message
...
I have the following Excel table:

x = blank cells

A B C D E F G H
1 x x x x x x M R
2 x x x x x M R T
3 x x x x M R T S
4 x x x M R T S Y
5 x x M R T S Y N
6 x M R T S Y N Q
7 M R T S Y N Q W
8 x x x x M R T S

I want to have Excel see the blanks (if there is one) and place the M in
column A and any cells up to column H to be back filled with the existing
data. Please see what I want the above table to look like after macro:

A B C D E F G H
1 M R R R R R R R
2 M R T T T T T T
3 M R T S S S S S
4 M R T S Y Y Y Y
5 M R T S Y N N N
6 M R T S Y N Q Q
7 M R T S Y N Q W
8 M R T S S S S S