View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] denys.p@videotron.ca is offline
external usenet poster
 
Posts: 5
Default Naming different ranges in the same column

Hi,

In my column H, I have three possibilities: Project, Support or Group. Is is possible with VBA to name a range of cells according to the data entered in those cells ?

In other words, I need to have three range of cells (that will change every day)

Before I only had one possibility which was Project which was assigned to a combobox in a userform. Therefore I used the following code:


Sub Proj()
On Error Resume Next
Dim L As Long
Sheet3.Select
With ActiveSheet()
If Range("B3").Value = "" Then Exit Sub

L = .Range("B65536").End(xlUp).Row
.Range("B2:B" & L).Name = "Proj"
End With
End Sub

Now, I want the combobox to reflect only the rows that contain the word Project or Support or Group in the column H If the user choose the checkbox Group, only the rows containing the word group in the column H should appear in the combobox. Same for Support or Project .

Any ideas ?

Thank you for your time
Denys