Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete from named range based on Combo Box selection


I have a named range on worksheet 1 (parts). That named range populate
a combo box on worksheet 3 by using a vlookup. Once a selection is mad
via the combo box, I want it to delete the exact entry from the name
range (hence deleting it from the combo box as well). I can delet
sequential rows based on a selection, but the combo box selections wil
not always be in order. The 1:1 match is the issue here.

Anyone done something like this already. Any help or hints would b
greatly appreciated.

Thanks,

Set

--
sheber
-----------------------------------------------------------------------
shebert's Profile: http://www.excelforum.com/member.php...fo&userid=2596
View this thread: http://www.excelforum.com/showthread.php?threadid=39333

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Delete from named range based on Combo Box selection

If your using a vlookup, this would imply that the value returned is not
necessarily unique.

that said, you can search through the values returned and find the one that
matches the value in the combobox.

there are various ways to search. Loop, use FIND, use Application.Match.

--
Regards,
Tom Ogilvy

"shebert" wrote in
message ...

I have a named range on worksheet 1 (parts). That named range populates
a combo box on worksheet 3 by using a vlookup. Once a selection is made
via the combo box, I want it to delete the exact entry from the named
range (hence deleting it from the combo box as well). I can delete
sequential rows based on a selection, but the combo box selections will
not always be in order. The 1:1 match is the issue here.

Anyone done something like this already. Any help or hints would be
greatly appreciated.

Thanks,

Seth


--
shebert
------------------------------------------------------------------------
shebert's Profile:

http://www.excelforum.com/member.php...o&userid=25965
View this thread: http://www.excelforum.com/showthread...hreadid=393335



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete from named range based on Combo Box selection


Maybe my original statement was a little unclear (sorry for the mix-up)


I have an excel 2000 workbook that has two worksheets. On worksheet(1
I have a named range (a list of parts). On worksheet(2) I have a comb
box that is populated from the named range on worksheet(1) by
vlookup. This combo box is listed several hundred times o
worksheet(2). Once a selection is made in the combo box, I would lik
to have it removed from the named range(worksheet1), hence removing i
from the combo box(worksheet2). Each selection can only be made once.

I have tried to record a macro to delete each part from the named rang
(worksheet1), but it will only delete in sequential order from the firs
selection (it is not intellegent). I have not programmed in a goo
while, so I was trying to work around any VBA, etc. However, I thin
that I may need some code to accomplish this task. Has anyone els
accomplished a task similar to this one? Can anyone shed some light o
this subject for me?

Thanks for your time,

Set

--
sheber
-----------------------------------------------------------------------
shebert's Profile: http://www.excelforum.com/member.php...fo&userid=2596
View this thread: http://www.excelforum.com/showthread.php?threadid=39333

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Delete from named range based on Combo Box selection

Public bBlockEvents as boolean

Private Sub Combobox1_click()
If Combobox1.ListIndex = -1 then exit sub
If bBlockEvents = True then exit sub
bBlockEvents = True
set rng = Range(Combobox1.RowSource)
set rng1 = rng.columns(1)
set rng2 = rng1(combobox1.ListIndex + 1)
Combobox1.RowSource = ""
rng2.EntireRow.Delete
set rng = rng.Resize(rows.count-1)
combobox1.RowSource = rng.Address(external:=True)
bBlockEvents = False
end Sub

would be a basic outline, but this would clear the selection in the combobox
and likewise in any linked cell. So there are things to play with here. I
suspect it could recursively call the click event - I have successfully
implemented similar in the past and recall it to be a bit screwy , but not
recently and I didn't play with this to check. If that doesn't work, try
putting similar code in the keydown event.

--
Regards,
Tom Ogilvy



"shebert" wrote in
message ...

Maybe my original statement was a little unclear (sorry for the mix-up).


I have an excel 2000 workbook that has two worksheets. On worksheet(1)
I have a named range (a list of parts). On worksheet(2) I have a combo
box that is populated from the named range on worksheet(1) by a
vlookup. This combo box is listed several hundred times on
worksheet(2). Once a selection is made in the combo box, I would like
to have it removed from the named range(worksheet1), hence removing it
from the combo box(worksheet2). Each selection can only be made once.

I have tried to record a macro to delete each part from the named range
(worksheet1), but it will only delete in sequential order from the first
selection (it is not intellegent). I have not programmed in a good
while, so I was trying to work around any VBA, etc. However, I think
that I may need some code to accomplish this task. Has anyone else
accomplished a task similar to this one? Can anyone shed some light on
this subject for me?

Thanks for your time,

Seth


--
shebert
------------------------------------------------------------------------
shebert's Profile:

http://www.excelforum.com/member.php...o&userid=25965
View this thread: http://www.excelforum.com/showthread...hreadid=393335



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete from named range based on Combo Box selection


Thanks for the reply. I will try it this evening. I was wondering i
it would be easier to pull the named range into a combo box (as it i
now) or just a basic drop down in excel for the task I am trying t
accomplish?

Thanks again,

Set

--
sheber
-----------------------------------------------------------------------
shebert's Profile: http://www.excelforum.com/member.php...fo&userid=2596
View this thread: http://www.excelforum.com/showthread.php?threadid=39333



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
Testing selection against named range [email protected][_2_] Excel Discussion (Misc queries) 5 April 17th 12 04:19 PM
Conditional Formating Based on Selection in a Combo Box adrian007uk Excel Discussion (Misc queries) 4 December 11th 09 08:54 AM
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM
combo box named range BB Excel Discussion (Misc queries) 2 June 21st 05 04:27 PM
Filling multiple cells based on 1 combo box selection Serrena Carter Excel Programming 1 August 30th 03 02:14 PM


All times are GMT +1. The time now is 10:04 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"