Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bmj Bmj is offline
external usenet poster
 
Posts: 5
Default Values from bold cells to combobox?

Hi,

I have several sheets with cell-values which I want to use in a ComboBox
(AddItem) - not the whole range, but only those cells with eg a bold font.
How can I do this with VBA? There are also some sheets where the wanted
cells are not with a bold fold, but with a "x" as value in the cell next to
it (differnt column). Is there an easy way of also including these values??

Best Regards,
Bmj


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Values from bold cells to combobox?


If Range("A1").Font.Bold Then
Combobox1.AddItem Range(A1").Value
End If

If Range("H1").Offset(0,1).Value = "x" Then
Combobox1.AddItem.Range("H1").Value
End If

--

HTH

RP

"Bmj" wrote in message
...
Hi,

I have several sheets with cell-values which I want to use in a ComboBox
(AddItem) - not the whole range, but only those cells with eg a bold font.
How can I do this with VBA? There are also some sheets where the wanted
cells are not with a bold fold, but with a "x" as value in the cell next

to
it (differnt column). Is there an easy way of also including these

values??

Best Regards,
Bmj




  #3   Report Post  
Posted to microsoft.public.excel.programming
Bmj Bmj is offline
external usenet poster
 
Posts: 5
Default Values from bold cells to combobox?

hmmm... no, it didn't work. The Combox is empty. But, this seems to work
(but only solves the bold font problem):

Dim rwindex As Integer
Dim colIndex As Integer

For rwindex = 1 To 10
For colIndex = 1 To 10
With Worksheets("Shett1").Cells(rwindex, colIndex)
If .Font.Bold = True Then Combobox1.AddItem
Cells(rwindex, colIndex).Value
End With
Next colIndex
Next rwindex

Regards,
Bmj


"Bob Phillips" skrev i melding
...

If Range("A1").Font.Bold Then
Combobox1.AddItem Range(A1").Value
End If

If Range("H1").Offset(0,1).Value = "x" Then
Combobox1.AddItem.Range("H1").Value
End If

--

HTH

RP

"Bmj" wrote in message
...
Hi,

I have several sheets with cell-values which I want to use in a ComboBox
(AddItem) - not the whole range, but only those cells with eg a bold

font.
How can I do this with VBA? There are also some sheets where the wanted
cells are not with a bold fold, but with a "x" as value in the cell next

to
it (differnt column). Is there an easy way of also including these

values??

Best Regards,
Bmj






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Values from bold cells to combobox?

so combine them


Dim rwindex As Integer
Dim colIndex As Integer

For rwindex = 1 To 10
For colIndex = 1 To 10
With Worksheets("Shett1").Cells(rwindex, colIndex)
If .Font.Bold = True Or _
.Offset(0,1).Value = "x" Then
Combobox1.AddItem _
Cells(rwindex, colIndex).Value
End If
End With
Next colIndex
Next rwindex


--

HTH

RP

"Bmj" wrote in message
...
hmmm... no, it didn't work. The Combox is empty. But, this seems to work
(but only solves the bold font problem):

Dim rwindex As Integer
Dim colIndex As Integer

For rwindex = 1 To 10
For colIndex = 1 To 10
With Worksheets("Shett1").Cells(rwindex, colIndex)
If .Font.Bold = True Then Combobox1.AddItem
Cells(rwindex, colIndex).Value
End With
Next colIndex
Next rwindex

Regards,
Bmj


"Bob Phillips" skrev i melding
...

If Range("A1").Font.Bold Then
Combobox1.AddItem Range(A1").Value
End If

If Range("H1").Offset(0,1).Value = "x" Then
Combobox1.AddItem.Range("H1").Value
End If

--

HTH

RP

"Bmj" wrote in message
...
Hi,

I have several sheets with cell-values which I want to use in a

ComboBox
(AddItem) - not the whole range, but only those cells with eg a bold

font.
How can I do this with VBA? There are also some sheets where the

wanted
cells are not with a bold fold, but with a "x" as value in the cell

next
to
it (differnt column). Is there an easy way of also including these

values??

Best Regards,
Bmj








  #5   Report Post  
Posted to microsoft.public.excel.programming
Bmj Bmj is offline
external usenet poster
 
Posts: 5
Default Values from bold cells to combobox?

Thank you :-))


"Bob Phillips" skrev i melding
...
so combine them


Dim rwindex As Integer
Dim colIndex As Integer

For rwindex = 1 To 10
For colIndex = 1 To 10
With Worksheets("Shett1").Cells(rwindex, colIndex)
If .Font.Bold = True Or _
.Offset(0,1).Value = "x" Then
Combobox1.AddItem _
Cells(rwindex, colIndex).Value
End If
End With
Next colIndex
Next rwindex


--

HTH

RP

"Bmj" wrote in message
...
hmmm... no, it didn't work. The Combox is empty. But, this seems to work
(but only solves the bold font problem):

Dim rwindex As Integer
Dim colIndex As Integer

For rwindex = 1 To 10
For colIndex = 1 To 10
With Worksheets("Shett1").Cells(rwindex, colIndex)
If .Font.Bold = True Then Combobox1.AddItem
Cells(rwindex, colIndex).Value
End With
Next colIndex
Next rwindex

Regards,
Bmj


"Bob Phillips" skrev i melding
...

If Range("A1").Font.Bold Then
Combobox1.AddItem Range(A1").Value
End If

If Range("H1").Offset(0,1).Value = "x" Then
Combobox1.AddItem.Range("H1").Value
End If

--

HTH

RP

"Bmj" wrote in message
...
Hi,

I have several sheets with cell-values which I want to use in a

ComboBox
(AddItem) - not the whole range, but only those cells with eg a bold

font.
How can I do this with VBA? There are also some sheets where the

wanted
cells are not with a bold fold, but with a "x" as value in the cell

next
to
it (differnt column). Is there an easy way of also including these
values??

Best Regards,
Bmj










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
Can I add values of a column that are only in bold format? Bytemylobster Excel Worksheet Functions 3 October 9th 09 01:42 AM
How do you sum just values that are bold in a list of values? Dominic Excel Worksheet Functions 3 September 9th 05 06:37 AM
Count bold text values Stan Altshuller Excel Worksheet Functions 1 June 7th 05 10:33 PM
How to bold daily max values Ginger Excel Discussion (Misc queries) 1 May 18th 05 06:28 PM
ComboBox Values Darren[_3_] Excel Programming 1 July 16th 03 10:41 AM


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