LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 226
Default Dave Peterson - last question


Hi Dave,

Sorry to be a pain, but I have one last question.

In the macro you had helped me with, I tried to add an additional "else" in
the event no match is found. Basically, this program is set-up to look for
matches and write the data to the corresponding cells which works great.
However, I've been trying to add additional code( with no luck) to have it
step down to first empty cell in Sheet2 and write the unmatched value from
Sheet1 in the event no Match is found.

I tried using something along the lines -.end (x1down).row - plus what I've
noted in the Macro, but I've had no luck. The best I could do was to get it
to add multiple empty rows instead of adding just the one value for the
unmatched cell.

I appreciate your review and this should finally put this particular routine
to rest.

Thanks - Roger
__________________________________________________ ________________

Dim WkbkARng as range
dim WkbkBRng as range
dim myCell as range
dim res as variant 'could be a number or an error

set wkbkARng =
workbooks("workbookA.xls").worksheets("sheet1").ra nge("E2:e100")
set wkbkBRng =
workbooks("workbookB.xls").worksheets("sheet2").ra nge("a2:a100") << looking
for match in same row and column D to be < ""

for each mycell in wkbkarng.cells
res = application.match(mycell.value,wkbkbrng,0)
if iserror(res) then

If Not wkbkbrng(res).Offset(0, 4).Value < "" Then

.............copy and write cells to offset of unmatchched value
to next empty cell......

<<<<tried adding irow here in event of no match - failed

else
mycell.offset(0,1).copy _
destination:=wkbkbrng(res).offset(0,1)

end if
next mycell
 
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
Follow-up Question for Dave Peterson Roger Excel Discussion (Misc queries) 3 February 28th 08 04:27 PM
Macro Question for Dave Peterson JoeSpareBedroom Excel Discussion (Misc queries) 5 February 14th 07 06:45 PM
Print question - Calling Dave Peterson! Ant Excel Discussion (Misc queries) 6 March 28th 06 12:57 PM
Print question - Calling Dave Peterson! Tom Ogilvy Excel Discussion (Misc queries) 1 March 27th 06 06:04 PM
Mr Dave peterson, Please help TUNGANA KURMA RAJU Excel Discussion (Misc queries) 5 December 7th 05 05:11 AM


All times are GMT +1. The time now is 07:30 AM.

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"