LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Option Buttons and List Boxes

Many thanks for that..bit of tweaking and it works perfectly... cheers.

sorry to ask, but i now have another question:..
the required info is returned to the respective cell via a vlookup
(example below) however this is only working when ListBox 4 is the
active listbox..it's not returning the relevant value when list box 5 is
active:

[Ranges are just a sample from about 50!]

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 33 Or Target.Row <= 44 And Target.Column = 2 Then
Select Case Target.Value
Case "YB"
DialogSheets("ACCCode").ListBoxes("List Box 4").ListFillRange = "'YB
Codes'!YBCodes"
Rng = "'YB Codes'!YBCodes"
Case "TECHNOLOGY"
DialogSheets("ACCCode").ListBoxes("List Box 4").ListFillRange =
"'NSE Codes'!NSECodes"
Rng = "'NSE Codes'!NSECodes"
Case "Please Select"
DialogSheets("ACCCode").ListBoxes("List Box 4").ListFillRange = ""
Rng = ""

End Select
End If


Sub DialogOK1()

ListIndex = DialogSheets("ACCCode").ListBoxes("List box
4").ListIndex
If Rng = "" Then
Exit Sub
Else
mytext =
Application.WorksheetFunction.VLookup((DialogSheet s("ACCCode").ListBoxes
("List box 4").List(ListIndex)), Range(Rng), 2, False)
ActiveCell.FormulaR1C1 = mytext
End If

ActiveCell.Offset(0, 1).Select

End Sub


what I want it to do is: "if list box 4 is selected, then vlookup
against this range and return relevant value" OR "if list box 5 is
selected, vlookup against that range and return relevant value"

I know it's probably simple, but I'm having difficulty working out how
to write this...and it's now 9.20pm and I'm dying to go
home....(starving!)

again, would really appreciate some guidance if you're able to help
here..

kind regards
Sue


Sydney, Australia / London, UK

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
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
Hide Group Boxes Around Option Buttons salqa Excel Worksheet Functions 9 November 7th 08 09:44 PM
Check Boxes or Option Buttons Lynda Excel Discussion (Misc queries) 3 April 4th 08 02:15 PM
option buttons or check boxes meandmyindigo via OfficeKB.com New Users to Excel 2 August 7th 06 12:55 PM
Form Option Buttons and Combo Boxes in VBA Newboy18 Excel Programming 1 June 30th 04 10:16 PM
Check Boxes and Option Buttons newboy18 Excel Programming 18 June 27th 04 07:00 PM


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