#1
|
|||
|
|||
Is there an easier way?
to give each green cases the number 1 value, yellow 0 and red -1 for example?
For now I'm doing them 1 by 1, but holy hell this is gonna be long. |
#2
|
|||
|
|||
Code:
Sub Maybe() Dim c As Range For Each c In Range("A1:D12") '<---- Change Range as required With c Select Case .Interior.Color Case Is = vbRed c.Value = -1 Case Is = vbGreen c.Value = 1 Case Is = vbYellow c.Value = 0 Case Else End Select End With Next c End Sub |
#3
|
|||
|
|||
If need be, you can get the RGB values with this.
Select a colored cell and run this code. Use this in the "Maybe_With_RGB()" macro Code:
Sub ShowColour() Dim RGBColour As String, R As Integer, G As Integer, B As Integer, c As Range RGBColour = Right("000000" & Hex(Selection.Interior.Color), 6) R = WorksheetFunction.Hex2Dec(Right(RGBColour, 2)) G = WorksheetFunction.Hex2Dec(Mid(RGBColour, 3, 2)) B = WorksheetFunction.Hex2Dec(Left(RGBColour, 2)) MsgBox "RGB(" & R & ", " & G & ", " & B & ")" End Sub Code:
Sub Maybe_With_RGB() Dim c As Range For Each c In Range("A1:D12") '<----- Change to actual used colored range With c Select Case .Interior.Color Case Is = RGB(255, 0, 0) '<----- Change to what you get for Red c.Value = -1 Case Is = RGB(0, 255, 0) '<----- Change to what you get for Green c.Value = 1 Case Is = RGB(255, 255, 0) '<----- Change to what you get for Yellow c.Value = 0 Case Else End Select End With Next c End Sub |
#4
|
|||
|
|||
ok first, what?
I'm not into coding at all, still pretty noob about Excel apparently :v oh and thanks a lot guys btw, dont wanna sound rude :3 Last edited by Hankced; 05-11-2018 at 08:09 AM. |
#5
|
||||
|
||||
What is the origin of the coloring? Manual?
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#6
|
|||
|
|||
How to install and run a macro.
https://www.ablebits.com/office-addi...a-macro-excel/ @Pecoflyer. I assumed that is is manual colored cells. |
#7
|
|||
|
|||
Allrighty, here are my problems:
1: I know nothing of coding, even less of Excel manipulation or w/e. I tried to follow the guide, but I'm stuck at somewhere in step 5 I guess? anyway 2. Either I'm working at school, which have some weird gimmick concerning saving files, and that 5th step lead me in a maze cause of that, or 3. I'm working at home with Excel online, which even the 2nd step (Alt+F11) doesn't do anything. There. I've hit a roadblock. And btw thanks alot for your help guys, but coding is bloating me. I mean, I don't mind learning, but by that point, I'm pretty sure filling my squares one by one would be faster y'know |
#8
|
||||
|
||||
Please answer post #5 - Thx
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#9
|
|||
|
|||
Oh yeah right sorry
Well, as far as I know, yep this is probably manual coloring. What's more, I used the ''standard colors'' (i dunno the proper terms in english since I'm working in french so please excuse my english) for ease. |
#10
|
|||
|
|||
Dunno if allowed, but bumping.
|
#11
|
|||
|
|||
Based on what you've supplied, it doesn't get any simpler than the first reply by jolivanes.
Posting the spreadsheet (as opposed to a picture of the spreadsheet) may prove things not to be as they seem. |
#12
|
||||
|
||||
If you need to do this while using Excel online too, VBA will not be an option. A slightly easier manual option would be to filter one column by each colour in turn, then populate all visible cells with the relevant values. Repeat for each column.
|
#13
|
|||
|
|||
Quote:
...eerr I seem to be unable to upload my work for some reasons?? What I think I understand is that it's saved in my OneDrive, I tried to Save As on the desktopthen upload it from there, since I apparently can't upload directly from my OneDrive. Sucks to be me eh |
#14
|
|||
|
|||
Say what? Y'know I don't wanna be annoying by being such a noob, but this seems to be an even simpler solution than coding. Thanks to all btw
|
#15
|
||||
|
||||
I had forgotten that you cannot (currently anyway) filter by colour in Excel online, if that's an issue.
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help making invoices easier | wbowles | Office | 0 | 07-17-2013 10:39 AM |
Please help me with an easier solution! | Inquisitor | Word | 1 | 06-26-2011 01:01 AM |
Easier highlighting? | atarei | Word | 0 | 08-27-2010 05:28 PM |
Microsoft Word Easier Navigation Question | xxlegendxx | Word | 0 | 03-22-2009 07:44 PM |