I was wondering if you could help me out with this vba code that I tried to use but I am not getting the desired result.
Data in Pivot Table
Low Cost Houses
Medium Cost Houses
I should be getting this result when running the vba code appearing at the bottom of this message -
but instead is getting
Dim cHse As Range
cCost = "Medium Cost Houses"
nRow = 5
Do While Worksheets("Bal").Range("A" & nRow) <> ""
Set cHse = .Cells.Find(What:=cCost, After:=.Cells(1), _
If cHse Is Nothing Then Exit Sub
Worksheets("Target").Range("A" & nTRow) = cHse
nRow = nRow + 1
I'm not sure I understand your question.
In your source data, you don't have a Mr. H but in expected result, you are showing a Mr. H.
Further the logic on which you are querying the data is not clear.
Can you explain you requirements more clearly so I can help.
If possible, please share a link to your file.
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here