Solved Populating Master Spreadsheet w/o Access

mjm6783

IT Wombat
Member
Local time
1:15 AM
Messages
66
Location
Portland, OR
Hey everyone,

I've got kind of a tricky one here. I need to have client information from three separate excel spreadsheet, auto populate a master list. I don't have the option of using access, so I'm left trying to use macros and visual basic programming.

The issue is really the sort and filter functions. I can bring the data from all three sources, and each client has a unique ID code. But replacing duplicate records and merging the rows from different spreadsheets is proving difficult.

Does anyone have any suggestions of an alternate way to achieve this? Or even some tips on the excel functions I should be using? Anything is appreciated.
 
Last edited:

My Computer My Computer

At a glance

XP Professional, 7 Professional
OS
XP Professional, 7 Professional
There could be some useful information here:
Top ten ways to clean your data - Excel - Office.com

Filter for unique values or remove duplicate values - Excel - Office.com

Third-party providers

The following is a partial list of third-party providers that have products that are used to clean data in a variety of ways.
Provider Product
Add-in Express Ltd. Advanced Find & Replace
Merge Cells Wizard
Add-Ins.com Duplicate Finder
AddinTools AddinTools Assist
J-Walk & Associates, Inc. Power Utility Pak Version 7
PATools PATools Advanced Find Replace
Vonnix Excel Power Expander 4.6
WinPure ListCleaner Lite
ListCleaner Pro
Clean and Match 2007
 

My Computer My Computer

At a glance

Windows 7 Home Premium 64bitIntel(R) Core(TM) i3-2120 CPU @ 3.30GHz3.00 GB(1) Intel(R) HD Graphics (2) VNC Mirror Driver
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Packard Bell
OS
Windows 7 Home Premium 64bit
CPU
Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz
Motherboard
Packard Bell IPISB-AG
Memory
3.00 GB
Graphics Card(s)
(1) Intel(R) HD Graphics (2) VNC Mirror Driver
Sound Card
Realtek High Definition Audio
Monitor(s) Displays
AIO LCD
Screen Resolution
1920 x 1080
Hard Drives
WDC WD10EADX-22TDHB0 ATA Device
Fixed hard disk media
4 partitions
931.51 GB
Keyboard
Wireless
Mouse
Wireless
Antivirus
Microsoft Security Essentials
Browser
IE; Firefox
Other Info
Also:
Samsung N220 Plus Netbook - Windows 7 Home
HP laptop
iPad 5
Ya, I'm aware of the filter sort functions. The real issue had to do with automating the procedure across three spreadsheets and three separate users over an intranet server.

I ended up getting some help from a guy over at excelforum. He worked with me to write some visual basic macros that are working pretty well. We still have a couple of kinks to work out, but I can post the basic code once it's up and running, in case anyone else has a similar problem.
 

My Computer My Computer

At a glance

XP Professional, 7 Professional
OS
XP Professional, 7 Professional
Ya, I'm aware of the filter sort functions. The real issue had to do with automating the procedure across three spreadsheets and three separate users over an intranet server.

I ended up getting some help from a guy over at excelforum. He worked with me to write some visual basic macros that are working pretty well. We still have a couple of kinks to work out, but I can post the basic code once it's up and running, in case anyone else has a similar problem.

Thank you for posting back, mjm6783. I am sure that others with the same problem would be very grateful for sharing your information. :D
 

My Computer My Computer

At a glance

Windows 7 Home Premium 64bitIntel(R) Core(TM) i3-2120 CPU @ 3.30GHz3.00 GB(1) Intel(R) HD Graphics (2) VNC Mirror Driver
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Packard Bell
OS
Windows 7 Home Premium 64bit
CPU
Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz
Motherboard
Packard Bell IPISB-AG
Memory
3.00 GB
Graphics Card(s)
(1) Intel(R) HD Graphics (2) VNC Mirror Driver
Sound Card
Realtek High Definition Audio
Monitor(s) Displays
AIO LCD
Screen Resolution
1920 x 1080
Hard Drives
WDC WD10EADX-22TDHB0 ATA Device
Fixed hard disk media
4 partitions
931.51 GB
Keyboard
Wireless
Mouse
Wireless
Antivirus
Microsoft Security Essentials
Browser
IE; Firefox
Other Info
Also:
Samsung N220 Plus Netbook - Windows 7 Home
HP laptop
iPad 5
So this is the MAIN section of code which is copied, (although altered slightly) for each of the workbooks which populate the master. It's set up for my specific needs in terms of specific column transfers and sorting/overwriting. There is some minor additional code, but it's unrelated to the functions shown here. Hope this helps someone out there. :p

Sub RunMe()
Dim wbTarget As Workbook
Dim wbSource As Workbook
Dim MyPath As String
Dim sLR As Long
Dim tLR As Long
Dim sCell As Range
Dim findMe As Range
Dim i As Long
MyPath = ActiveWorkbook.Path
Set wbSource = ThisWorkbook

On Error Resume Next
Set wbTarget = Workbooks("Master.xlsx")
If wbTarget Is Nothing Then 'Not Open
Application.Workbooks.Open (MyPath & "\" & "Master.xlsx")
On Error GoTo 0
Set wbTarget = Workbooks("Master.xlsx")
Else
End If
With wbTarget.Sheets("Sheet1")
tLR = .Range("A" & .Rows.Count).End(xlUp).Row + 1
End With

For i = 1 To wbSource.Sheets.Count
With wbSource.Sheets(i)
sLR = .Range("A" & .Rows.Count).End(xlUp).Row
If sLR <= 1 Then GoTo skip
End With
For Each sCell In wbSource.Sheets(i).Range("B2:B" & sLR)
If Not wbSource.Sheets(i).Range("Z" & sCell.Row) = "X" Then
Set findMe = wbTarget.Sheets("Sheet1").Range("B2:B" & tLR).Find(What:=sCell, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
MatchCase:=False)

If findMe Is Nothing Then
wbTarget.Sheets("Sheet1").Range("B" & tLR).Value = sCell.Value
wbTarget.Sheets("Sheet1").Range("A" & tLR).Value = sCell.Offset(0, -1).Value
wbTarget.Sheets("Sheet1").Range("A" & tLR).Offset(0, 5).Value = sCell.Offset(0, 1).Value
wbTarget.Sheets("Sheet1").Range("A" & tLR).Offset(0, 6).Value = sCell.Offset(0, 2).Value
wbTarget.Sheets("Sheet1").Range("A" & tLR).Offset(0, 7).Value = sCell.Offset(0, 3).Value
wbTarget.Sheets("Sheet1").Range("A" & tLR).Offset(0, 8).Value = sCell.Offset(0, 4).Value
wbTarget.Sheets("Sheet1").Range("A" & tLR).Offset(0, 9).Value = sCell.Offset(0, 5).Value
wbTarget.Sheets("Sheet1").Range("A" & tLR).Offset(0, 10).Value = sCell.Offset(0, 6).Value
tLR = wbTarget.Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row + 1
wbSource.Sheets(i).Range("Z" & sCell.Row) = "X"
Else
wbTarget.Sheets("Sheet1").Range("B" & findMe.Row).Value = sCell.Value
wbTarget.Sheets("Sheet1").Range("A" & findMe.Row).Value = sCell.Offset(0, -1).Value
wbTarget.Sheets("Sheet1").Range("A" & findMe.Row).Offset(0, 5).Value = sCell.Offset(0, 1).Value
wbTarget.Sheets("Sheet1").Range("A" & findMe.Row).Offset(0, 6).Value = sCell.Offset(0, 2).Value
wbTarget.Sheets("Sheet1").Range("A" & findMe.Row).Offset(0, 7).Value = sCell.Offset(0, 3).Value
wbTarget.Sheets("Sheet1").Range("A" & findMe.Row).Offset(0, 8).Value = sCell.Offset(0, 4).Value
wbTarget.Sheets("Sheet1").Range("A" & findMe.Row).Offset(0, 9).Value = sCell.Offset(0, 5).Value
wbTarget.Sheets("Sheet1").Range("A" & findMe.Row).Offset(0, 10).Value = sCell.Offset(0, 6).Value
tLR = wbTarget.Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row + 1
wbSource.Sheets(i).Range("Z" & sCell.Row) = "X"
End If
End If
Next sCell

skip:
Next i

Application.ScreenUpdating = False
With wbTarget.Sheets("Sheet1")
tLR = .Cells.Find("*", .Cells(Rows.Count, .Columns.Count), SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
.Sort.SortFields.Clear
.Sort.SortFields.Add Key:=.Range("A2:A" & tLR), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
End With
With wbTarget.Sheets("Sheet1").Sort
.SetRange Range("A1:K" & tLR)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Application.ScreenUpdating = True

Flag = True
wbTarget.Close True
Set wbTarget = Nothing
Set wbSource = Nothing

End Sub
 

My Computer My Computer

At a glance

XP Professional, 7 Professional
OS
XP Professional, 7 Professional
Back
Top