Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-10-2018, 12:25 PM
Hankced Hankced is offline Is there an easier way? Windows 7 64bit Is there an easier way? Office 2016
Novice
Is there an easier way?
 
Join Date: Apr 2018
Posts: 11
Hankced is on a distinguished road
Default 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.
Attached Images
File Type: gif VCX.gif (210.9 KB, 57 views)
Reply With Quote
  #2  
Old 05-10-2018, 09:40 PM
jolivanes jolivanes is offline Is there an easier way? Windows 10 Is there an easier way? Office 2013
Advanced Beginner
 
Join Date: Sep 2011
Posts: 93
jolivanes will become famous soon enough
Default

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
You might have to find out the RGB colors of the cells and change the code accordingly
Reply With Quote
  #3  
Old 05-10-2018, 10:30 PM
jolivanes jolivanes is offline Is there an easier way? Windows 10 Is there an easier way? Office 2013
Advanced Beginner
 
Join Date: Sep 2011
Posts: 93
jolivanes will become famous soon enough
Default

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 to fill with numbers
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
Reply With Quote
  #4  
Old 05-11-2018, 05:26 AM
Hankced Hankced is offline Is there an easier way? Windows 7 64bit Is there an easier way? Office 2016
Novice
Is there an easier way?
 
Join Date: Apr 2018
Posts: 11
Hankced is on a distinguished road
Default

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.
Reply With Quote
  #5  
Old 05-11-2018, 09:28 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Is there an easier way? Windows 7 64bit Is there an easier way? Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,768
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

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
Reply With Quote
  #6  
Old 05-11-2018, 12:10 PM
jolivanes jolivanes is offline Is there an easier way? Windows 10 Is there an easier way? Office 2013
Advanced Beginner
 
Join Date: Sep 2011
Posts: 93
jolivanes will become famous soon enough
Default

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.
Reply With Quote
  #7  
Old 05-15-2018, 06:39 PM
Hankced Hankced is offline Is there an easier way? Windows 7 64bit Is there an easier way? Office 2016
Novice
Is there an easier way?
 
Join Date: Apr 2018
Posts: 11
Hankced is on a distinguished road
Default

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
Reply With Quote
  #8  
Old 05-16-2018, 12:10 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Is there an easier way? Windows 7 64bit Is there an easier way? Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,768
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

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
Reply With Quote
  #9  
Old 05-16-2018, 05:17 AM
Hankced Hankced is offline Is there an easier way? Windows 7 64bit Is there an easier way? Office 2016
Novice
Is there an easier way?
 
Join Date: Apr 2018
Posts: 11
Hankced is on a distinguished road
Default

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.
Reply With Quote
  #10  
Old 06-18-2018, 05:14 AM
Hankced Hankced is offline Is there an easier way? Windows 7 64bit Is there an easier way? Office 2016
Novice
Is there an easier way?
 
Join Date: Apr 2018
Posts: 11
Hankced is on a distinguished road
Default

Dunno if allowed, but bumping.
Reply With Quote
  #11  
Old 06-18-2018, 12:30 PM
NoSparks NoSparks is offline Is there an easier way? Windows 7 64bit Is there an easier way? Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

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.
Reply With Quote
  #12  
Old 06-19-2018, 02:47 AM
Debaser's Avatar
Debaser Debaser is offline Is there an easier way? Windows 7 64bit Is there an easier way? Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

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.
Reply With Quote
  #13  
Old 06-19-2018, 05:15 AM
Hankced Hankced is offline Is there an easier way? Windows 7 64bit Is there an easier way? Office 2016
Novice
Is there an easier way?
 
Join Date: Apr 2018
Posts: 11
Hankced is on a distinguished road
Default

Quote:
Originally Posted by NoSparks View Post
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.
There we go, sorry and thanks lol dunno why I didn't think bout that lol
...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
Reply With Quote
  #14  
Old 06-19-2018, 05:19 AM
Hankced Hankced is offline Is there an easier way? Windows 7 64bit Is there an easier way? Office 2016
Novice
Is there an easier way?
 
Join Date: Apr 2018
Posts: 11
Hankced is on a distinguished road
Default

Quote:
Originally Posted by Debaser View Post
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.
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
Reply With Quote
  #15  
Old 06-19-2018, 07:24 AM
Debaser's Avatar
Debaser Debaser is offline Is there an easier way? Windows 7 64bit Is there an easier way? Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

I had forgotten that you cannot (currently anyway) filter by colour in Excel online, if that's an issue.
Reply With Quote
Reply

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
Is there an easier way? 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

Other Forums: Access Forums

All times are GMT -7. The time now is 01:34 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft