TotalRapture
New Member
- Joined
- Jun 30, 2017
- Messages
- 15
Morning everybody!
My knowledge regarding VBA is a little scattered; I can do some very specific things but trying to step outside of those particulars and I generally hit a lot of walls due to my lack of foundational knowledge.
I would like to search a table for cells with specific formatting and then copy those cells to another row. I'm kind of starting from scratch; I have been playing with different formula/code for the passed day or so but have not made much headway.
I found this function to at least count the highlighted cells online:
Function CountColor(rRange As range, specify As range) As Long
Dim data As range
Dim color As Long
color = specify.Interior.ColorIndex
For Each data In rRange
If data.Interior.ColorIndex = color Then
CountColor = CountColor + 1
End If
Next data
End Function
And it was working on my test sheet but I could not replicate it on the actual data. I believe this could be due to the data being highlighted using Conditional Formatting. I think if I could get this working on the data sheet I could rewrite/add to it in a way that it will take the highlighted cell contents and paste it somewhere else (end goal), but, admittedly, there's a good chance I'll need some help with that as well.
If anyone could help me out with getting it to pick up the conditionally formatted cells I could start playing with the next level and I would be hella appreciative. Thanks for your time!
My knowledge regarding VBA is a little scattered; I can do some very specific things but trying to step outside of those particulars and I generally hit a lot of walls due to my lack of foundational knowledge.
I would like to search a table for cells with specific formatting and then copy those cells to another row. I'm kind of starting from scratch; I have been playing with different formula/code for the passed day or so but have not made much headway.
I found this function to at least count the highlighted cells online:
Function CountColor(rRange As range, specify As range) As Long
Dim data As range
Dim color As Long
color = specify.Interior.ColorIndex
For Each data In rRange
If data.Interior.ColorIndex = color Then
CountColor = CountColor + 1
End If
Next data
End Function
And it was working on my test sheet but I could not replicate it on the actual data. I believe this could be due to the data being highlighted using Conditional Formatting. I think if I could get this working on the data sheet I could rewrite/add to it in a way that it will take the highlighted cell contents and paste it somewhere else (end goal), but, admittedly, there's a good chance I'll need some help with that as well.
If anyone could help me out with getting it to pick up the conditionally formatted cells I could start playing with the next level and I would be hella appreciative. Thanks for your time!