Solved

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

Posted on 2011-02-11
6
304 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

733 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