transpose 3d cells to a column in single workbook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to extract 3d cells from a set of worksheets into a single
column on another worksheet within the same workbook. How can I do this?
 
Insert a worksheet named Summary, then select the 3D range, and run the
macro below.

HTH,
Bernie
MS Excel MVP

Sub TryNow()
Dim mySht As Worksheet
Dim dataSht As Worksheet
Dim myRange As Range
Dim myCell As Range

Set dataSht = Worksheets("Summary")
Set myRange = Selection

For Each mySht In ActiveWindow.SelectedSheets
For Each myCell In mySht.Range(myRange.Address)
dataSht.Range("A65536").End(xlUp)(2).Value = _
myCell.Value
Next myCell
Next mySht

End Sub
 
Thanks, but this will not update the values if the referenced 3d cells
change. I guess that I really want to convert cell references to a column of
links to the 3d cells. Can this be done?
 
Of course. You can do anything! (almost ;-))

Change

dataSht.Range("A65536").End(xlUp)(2).Value = _
myCell.Value

to

dataSht.Range("A65536").End(xlUp)(2).Formula = _
"=" & myCell.Address(False, False, xlA1, True)

HTH,
Bernie
MS Excel MVP
 
Thanks, that worked. Now can I rename this module so that i can set up
several versions which load different 3d ranges into different columns of the
summary worksheet. I have figured out which parameter to change to change
the column -- change A65536 to B65536.

Thanks
 
You seem to have answered your own question, but I will still ask: Do you
need further help?

HTH,
Bernie
MS Excel MVP
 
In the Properties window in the VBE (press F4 if it isn't showing) you can
change the module's name property when the module is the selected object in
the object explorer.

HTH,
Bernie
MS Excel MVP
 
Or, if you mean the macro, simply change the string after the keyword Sub:

Sub TryNow()
.....
End Sub

Sub TryNow2()
.....
End Sub

Sub DoColumnA()
.....
End Sub

HTH,
Bernie
MS Excel MVP
 
That's what I needed.

Thanks for your help.

Bernie Deitrick said:
Or, if you mean the macro, simply change the string after the keyword Sub:

Sub TryNow()
.....
End Sub

Sub TryNow2()
.....
End Sub

Sub DoColumnA()
.....
End Sub

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top