How to identify text (compare) in one sheet, then move it another

M

mag7417

Hi!

I have a problem I hope someone here can help me with. I have tw
sheets in my excel file.

Sheet 1: A table of contents. All in the A column (e.g. "1.2.4 This an
that")
E.g.
1 Introduction
1.1 Purpose
2
3
3.1
3.1.1

Sheet 2: The entire document. An ID# in A and then the text in B.

What I want to do is to match all the ID's in sheet two to the ToC i
sheet one. I.e. I "simply" want each ID# for each heading in th
document to show up in sheet one. I also want all ID's under eac
heading to be inserted under each heading in the ToC.

It is all a requirement doc listing for all the requirements. Basicall
what I want to do is to list all the eq ID's in sheet two under with th
corresponding heading in sheet one
 
M

mag7417

You suggest I use word for what I want to do? Well, I wish I could but
am working with excel and to tell you the truth I don't understand you
comment. How could I accomplish what I want to do then?

Sincerely,

M
 
K

keepITcool

I use Excel for practically anything.
but for what you want to do MsWord seems a better tool.

it can autonumber your paragraphs, create an outline etc.

If you want to do that in Excel you've got to write a macro
like:

Sub CreateOutline()
Dim rngText As Range
Dim rngSumm As Range
Dim rngCell As Range
Dim lRow&

With Worksheets(1)
Set rngSumm = Intersect(.UsedRange, .Columns(1))
End With

With Worksheets(2)
Set rngText = Intersect(.UsedRange, .Columns(1))
End With

rngSumm.Clear
Set rngSumm = rngSumm.Cells(1)
For Each rngCell In rngText.Cells
If Len(rngCell) Then
lRow = lRow + 1
With rngSumm(lRow, 1)
.Hyperlinks.Add Anchor:=.Cells(1), _
Address:="", _
SubAddress:="'" & rngCell.Worksheet.Name & _
"'!" & rngCell.Address(), _
TextToDisplay:=rngCell.Text
End With
End If
Next

End Sub


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


mag7417 wrote :
 
M

mag7417

I just want to say that I appreciate the help. The thing is that I nee
to do it in excel. Not a lot of fun, but it still needs to be done.
will try to look at what you sent me. I think perhaps there may be som
errors in what you sent me but I am sure
 

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

Top