Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default worksheet_change event with a combo box

im having trouble finding the right VB code to enter to allow me to mak
the spreadsheet automatically update the input range for a combo box o
one page when new data is added into a table on another page.

if anyone can give me any tips at all on this i would be very grateful

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default worksheet_change event with a combo box

Here's some worksheet event code that will trap a change in column A of
sheet 2, and re-set the combobox range on sheet 1

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = True
On Error GoTo ws_exit
If Target.Column = 1 Then
Worksheets("Sheet1").ComboBox1.ListFillRange = _
Range("A1").Resize(Cells(Rows.Count, "A").End(xlUp).Row,
1).Address
End If

ws_exit:
Application.EnableEvents = True
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"ice_cool " wrote in message
...
im having trouble finding the right VB code to enter to allow me to make
the spreadsheet automatically update the input range for a combo box on
one page when new data is added into a table on another page.

if anyone can give me any tips at all on this i would be very grateful.


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default worksheet_change event with a combo box

Three different types of comboboxes -
Control Toolbox Toolbar
Forms Toolbar
Data=Validation using the list option.

Which are you using and how do you populate it?

More details, better answers.

--
Regards,
Tom Ogilvy

"ice_cool " wrote in message
...
im having trouble finding the right VB code to enter to allow me to make
the spreadsheet automatically update the input range for a combo box on
one page when new data is added into a table on another page.

if anyone can give me any tips at all on this i would be very grateful.


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default worksheet_change event with a combo box

oops, sorry, forgot a bit.

Try this instead

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = True
On Error GoTo ws_exit
If Target.Column = 1 Then
Worksheets("Sheet1").ComboBox1.ListFillRange = _
Me.Name & "!" & _
Range("A1").Resize(Cells(Rows.Count, "A").End(xlUp).Row,
1).Address
End If

ws_exit:
Application.EnableEvents = True
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Bob Phillips" wrote in message
...
Here's some worksheet event code that will trap a change in column A of
sheet 2, and re-set the combobox range on sheet 1

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = True
On Error GoTo ws_exit
If Target.Column = 1 Then
Worksheets("Sheet1").ComboBox1.ListFillRange = _
Range("A1").Resize(Cells(Rows.Count, "A").End(xlUp).Row,
1).Address
End If

ws_exit:
Application.EnableEvents = True
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"ice_cool " wrote in message
...
im having trouble finding the right VB code to enter to allow me to make
the spreadsheet automatically update the input range for a combo box on
one page when new data is added into a table on another page.

if anyone can give me any tips at all on this i would be very grateful.


---
Message posted from http://www.ExcelForum.com/





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
Disabling WORKSHEET_CHANGE event Jase Excel Discussion (Misc queries) 1 April 25th 08 04:32 PM
Problem with Worksheet_Change event Romuald Excel Programming 2 January 19th 04 09:41 AM
Worksheet_Change Event Sam Excel Programming 2 November 21st 03 06:51 PM
Worksheet_Change event question marwan hefnawy Excel Programming 1 September 10th 03 08:53 PM
Worksheet_Change Event Not Working Michael Beckinsale Excel Programming 0 August 1st 03 02:43 PM


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