Solved

Unable to Search Merged Cells with V-lookup in Excel 2007

Posted on 2011-02-11
6
301 Views
Last Modified: 2012-05-11
I receive quarterly database update files up to 20,000 rows long. Column A contains some merged cells. I need to perform v-lookups to compare my data to their file information in column B & C. This gives me all the applicable rev codes for any given procedure code.

1) How do I perform a v-lookup with multiple results possible?

2) Is there a way to un-merge the cells in column A and duplicate the correct procedure code into the newly created blank cells?

I greatly appreciate any assistance, and there is no rush.
 Example-1.xlsx
0
Comment
Question by:nts42a
  • 3
  • 3
6 Comments
 
LVL 5

Accepted Solution

by:
roger_karam earned 500 total points
ID: 34874106
Both vlookup and pivot tables use the first result. You would have to use a macro to unmerge. This one worked for me:

Sub unmerger()

Dim rReference As Range
Dim rIterator As Range


Set rReference = ActiveSheet.Range("A1:A20000")


For Each rIterator In rReference

If rIterator.MergeCells = True Then

rIterator.MergeCells = False

If rIterator.Offset(1, 0).Value = "" Then

rIterator.Offset(1, 0).Value = rIterator.Value
End If

End If


Next rIterator


End Sub
0
 
LVL 5

Expert Comment

by:roger_karam
ID: 34874127
oh, and after unmerging use a Pivot Table with the values you want to see in Column - this will show both values while using vlookup will still only return the first.

Sincerely,
RK
0
 

Author Comment

by:nts42a
ID: 34874437
Well, that was a start. It did unmerge the cells, and copied some of the data to blank cells. However, it leaves a significant number empty. Example-2.xlsx
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

Assisted Solution

by:nts42a
nts42a earned 0 total points
ID: 34874906
I was able to find a solution to this last question from a previous thread (Title: if null excel.) Thanks - matthewspatrick. I will accept multiple solutions and award points. Then I will post the next question if I am unable to find a previous thread dealing with the multiple data returns.
0
 

Author Closing Comment

by:nts42a
ID: 34904858
I would also like to thank matthewspatrick for "Title if null excel"
0
 
LVL 5

Expert Comment

by:roger_karam
ID: 34935095
Thanks for the points nts42a! Sorry i missed the blank cells.

sincerely,
RK
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question