Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 226
Default Follow-up Question for Dave Peterson

Good Morning Dave,

I'm wondering if it's possible to add an additional condition to the Match
Row for the Sheet1 look-up?

After the Sheet1 Match is found in Sheet2 Column A, I'm also looking to add
a condition so that Sheet2 Column D is < "" before returning the Match value
to the noted sheet location.

Is that a possibility?

Thank you for your review once again - 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

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

end if
next mycell
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Follow-up Question for Dave Peterson

I'm not sure what
< ""
means

But you could add the condition he

for each mycell in wkbkarng.cells
res = application.match(mycell.value,wkbkbrng,0)
if iserror(res) then
'do nothing
else
'change this to what you mean
if wkbkbrng(res).offset(0,1).value < 9999 then
'do the work
mycell.offset(0,1).copy _
destination:=wkbkbrng(res).offset(0,1)
else
'skip it
end if
end if
next mycell

Roger wrote:

Good Morning Dave,

I'm wondering if it's possible to add an additional condition to the Match
Row for the Sheet1 look-up?

After the Sheet1 Match is found in Sheet2 Column A, I'm also looking to add
a condition so that Sheet2 Column D is < "" before returning the Match value
to the noted sheet location.

Is that a possibility?

Thank you for your review once again - 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

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

end if
next mycell


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 226
Default Follow-up Question for Dave Peterson

Thank you so much Dave - exactly what I needed and works great.

<"" meant greater than nothing, but I should have actually written it out.

Thanks again and you're the best - Roger

"Dave Peterson" wrote:

I'm not sure what
< ""
means

But you could add the condition he

for each mycell in wkbkarng.cells
res = application.match(mycell.value,wkbkbrng,0)
if iserror(res) then
'do nothing
else
'change this to what you mean
if wkbkbrng(res).offset(0,1).value < 9999 then
'do the work
mycell.offset(0,1).copy _
destination:=wkbkbrng(res).offset(0,1)
else
'skip it
end if
end if
next mycell

Roger wrote:

Good Morning Dave,

I'm wondering if it's possible to add an additional condition to the Match
Row for the Sheet1 look-up?

After the Sheet1 Match is found in Sheet2 Column A, I'm also looking to add
a condition so that Sheet2 Column D is < "" before returning the Match value
to the noted sheet location.

Is that a possibility?

Thank you for your review once again - 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

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

end if
next mycell


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Follow-up Question for Dave Peterson

I'd use either:
if wkbkbrng(res).offset(0,1).value < "" then
or even
if trim(wkbkbrng(res).offset(0,1).value) < "" then

Roger wrote:

Thank you so much Dave - exactly what I needed and works great.

<"" meant greater than nothing, but I should have actually written it out.

Thanks again and you're the best - Roger

"Dave Peterson" wrote:

I'm not sure what
< ""
means

But you could add the condition he

for each mycell in wkbkarng.cells
res = application.match(mycell.value,wkbkbrng,0)
if iserror(res) then
'do nothing
else
'change this to what you mean
if wkbkbrng(res).offset(0,1).value < 9999 then
'do the work
mycell.offset(0,1).copy _
destination:=wkbkbrng(res).offset(0,1)
else
'skip it
end if
end if
next mycell

Roger wrote:

Good Morning Dave,

I'm wondering if it's possible to add an additional condition to the Match
Row for the Sheet1 look-up?

After the Sheet1 Match is found in Sheet2 Column A, I'm also looking to add
a condition so that Sheet2 Column D is < "" before returning the Match value
to the noted sheet location.

Is that a possibility?

Thank you for your review once again - 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

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

end if
next mycell


--

Dave Peterson


--

Dave Peterson
Reply
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
Macro Question for Dave Peterson JoeSpareBedroom Excel Discussion (Misc queries) 5 February 14th 07 06:45 PM
Dave Peterson Rich_Patterson Excel Discussion (Misc queries) 2 January 26th 07 08:56 PM
Dave Peterson joelbeveridge Excel Discussion (Misc queries) 1 August 4th 06 02:55 AM
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


All times are GMT +1. The time now is 05:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"