Jan 15 2020 01:13 AM
Hi Team,
so i have tables below and I want assigned cells filled with color red, yellow, and white converted to corresponding numbers. any idea or help is very muchappreciaTED
Red | 1 |
Yellow | 2 |
White | 3 |
Jan 15 2020 03:58 AM
Jan 15 2020 04:09 AM
Jan 15 2020 04:15 AM
Jan 15 2020 05:32 AM
@PascalKTeam - can you share please the VB code would really appreciate it
Jan 15 2020 05:49 AM
Jan 15 2020 06:26 AM
Jan 15 2020 06:54 AM
Jan 15 2020 07:45 AM
Jan 15 2020 07:53 AM
Open the VBA editor with Alt+F11
The VBA code is in Sheet 1
The column with the color is defined here:
If Cells(x, 1).Interior.ColorIndex = 3 Then Cells(x, 1).Offset(0, 1) = 1
Becasue A is the first column, there is a 1. If you want to change to column C, just change this number to 3
The column where the number is pasted is defined here
If Cells(x, 1).Interior.ColorIndex = 3 Then Cells(x, 1).Offset(0, 1) = 1
It's defined as an offset of 1 to the right of the colored cell. but you could also offset it by a different number.
Just play around with it to see what happens when you change these numbers.
Jan 15 2020 09:43 AM
Jan 15 2020 09:48 AM
SolutionJan 15 2020 10:05 AM
@PascalKTeam Thank you so much it works perfectly
Jan 22 2020 11:54 AM
@PascalKTeam Hi -
I did use the code to diff file woudl oyu know why its not working? theres no error message but for some reason its not working
Jan 22 2020 11:57 AM
Jan 22 2020 12:20 PM
@PascalKTeam yes so basically I have two diff file name but the same source both file only have two sheets so the first one just perfectly working but the other one for some reason its not running...
Jan 22 2020 12:23 PM
Jan 22 2020 12:25 PM
@PascalKTeam its all good now thank you i restarfted my laptop and it worked thank you... can you help me with my other qeuries?
Jan 22 2020 12:27 PM
Jan 15 2020 09:48 AM
Solution