KENNETH BATILO
Member
Members
Forum Posts: 32
Member Since:
January 30, 2020
January 30, 2020
Offline
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: Hans Hallebeek
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
Catalin Bombea: 1939
SunnyKow: 1432
Anders Sehlstedt: 918
Purfleet: 415
Frans Visser: 349
Hans Hallebeek: 333
David_Ng: 306
lea cohen: 248
Jessica Stewart: 219
A.Maurizio: 216
Newest Members:
Crystal Harris
Amaan Abdi
Sarah Yelland
Ahsan AYUB
Daniel Neilson
Joy Nicholes
Earl Hanlon
Paulo Pinto
Tavonga Machigere
Marc Poulopoulos
Forum Stats:
Groups: 3
Forums: 25
Topics: 7058
Posts: 30934
Member Stats:
Guest Posters: 49
Members: 34430
Moderators: 2
Admins: 3
Administrators: Mynda Treacy, Philip Treacy, Jessica
Moderators: Velouria, Riny van Eekelen
© Simple:Press —