
KENNETH BATILO
Member
Members

Forum Posts: 27
Member Since:
January 30, 2020
January 30, 2020

Hi all!
I need help with a VBA macro. What I need is: If a cell is (color) blue, then pull value from a different column on the same row. (I am using a table.)
Column1 | Column2 | Column3 | Column4 | Column5 | Column6 | Column7 |
(Color Blue) | Test1 | |||||
Test2 | ||||||
Test3 | ||||||
(Color Blue) | Test4 | |||||
Test5 |
result looking for
Column1 | Column2 | Column3 | Column4 | Column5 | Column6 | Column7 |
Test1 | Test1 | |||||
Test2 | ||||||
Test3 | ||||||
Test4 | Test4 | |||||
Test5 |
So far I got (Below is just an example and not sure if it's correct)
'Declare Sheet 1
Dim sh1 as Worksheet
Set sh1=Sheet1
'Delcare Sheet 1 column 1
Dim sh1c1 as Range
Set sh1c1=sh1.ListObjects("Table1").ListColumns(1).DataBodyRange
'Declare sheet 1 column 6
Dim sh1c6 as Range
Set sh1c6=sh1.ListObjects("Table1").ListColumns(6).DataBodyRange
'If cell is blue then column 6
If sh1c1.Interior.Color=RGB(0,112,192) then sh1c6.value
End If
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Jeanine Hagge
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 871
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
Jessica Stewart: 205
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Othman AL MUTAIRI
Misael Gutierrez Sr.
Attif Ihsan
Kieran Fee
Murat Hasanoglu
Brett Dryland
Saeed Aldousari
Bhuwan Devkota
Kathryn Patton
Maria Conatser
Forum Stats:
Groups: 3
Forums: 24
Topics: 6222
Posts: 27293
Member Stats:
Guest Posters: 49
Members: 31917
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —
