#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Macro help

Awhile ago I had help with the below macro. I'm running it again, but I have
9 columns now. How can I modify this macro so that the data in column c that
is in Sheet B but not in sheet A is displayed? I still need the rest of the
functions of the macro to work.

Example of what is happening:
In Sheet A:
ID NAME Location

ABCDK2 Hank Doe

In Sheet B
ID NAME Location
ABCDK2 Hank Doe California

When I run the macro, California is not being displayed in the Summary,that
field is blank because in Sheet A, it is blank and that is what is read first.

Thanks!


"Bernie Deitrick" wrote:

Then try the version below, which acts on column A... As far as choosing
between Jeanne Doe
and
Doe JEANNE
whichever is found first will be used.

HTH,
Bernie
MS Excel MVP


Sub MakeSummarySheetV3()
Dim mySht As Worksheet
Dim mySumSheet As Worksheet
Dim myCell As Range
Dim myDest As Range
Dim myRow As Long

On Error Resume Next
Application.DisplayAlerts = False
Worksheets("Summary").Delete
Application.DisplayAlerts = True

ActiveSheet.Copy Befo=Sheets(1)
Set mySumSheet = ActiveSheet
mySumSheet.Name = "Summary"

For Each mySht In ActiveWorkbook.Worksheets
If mySht.Name = "Summary" Then GoTo SkipMe:
Set myDest = mySumSheet.Cells(1, 256).End(xlToLeft)(1, 2)
myDest.Value = mySht.Name
Set myDest = myDest.EntireColumn

For Each myCell In mySht.Range("A1").CurrentRegion.Columns(1).Cells
If myCell.Row < 1 Then
If Not IsError(Application.Match(myCell.Value, _
mySumSheet.Range("A:A"), False)) Then
myDest.Cells(Application.Match(myCell.Value, _
mySumSheet.Range("A:A"), False)).Value = "X"
Else
myRow = mySumSheet.Cells(Rows.Count, 1).End(xlUp)(2).Row
mySumSheet.Cells(myRow, 1).Value = myCell.Value
mySumSheet.Cells(myRow, 2).Value = myCell.Offset(0, 1).Value
mySumSheet.Cells(myRow, 3).Value = myCell.Offset(0, 2).Value
myDest.Cells(myRow).Value = "X"
End If
End If
Next myCell
SkipMe:
Next mySht

End Sub

"NeedExcelHelp07" wrote in
message ...
What I'm getting:

PRIMARY SECONDARY ID NAME Software A Software B Software C
Software d....
BZ0T23 Jeanne Doe X
BZ0T23 Doe JEANNE X
X
BZ0T23 Doe JEANNE
X

Ok the above is what I'm getting after running the Macro.

So I'm asking how to merge them to make it look like below:
PRIMARY SECONDARY ID NAME Software A Software B Software C
Software d....
BZ0T23 Jeanne Doe X X
X X

Other than this, the Macro works well.

Thanks alot for the help.





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro not showing in Tools/Macro/Macros yet show up when I goto VBA editor [email protected] Excel Programming 2 March 30th 07 07:48 PM
Need syntax for RUNning a Word macro with an argument, called from an Excel macro Steve[_84_] Excel Programming 3 July 6th 06 07:42 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 05:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"