• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro Hell Pt. II

Zach

Member
Ok as my daily cycle with Upper Management changes to a file I need to revamp a macro to do the following within the attached spreadsheet.
1. Turn the yellow cells (which will be protected from data changes) Bold.
2. And not allow the "yellow" complete button to make any formatting changes to any blue cells, redish cells or white formated cells.

Currently the Blue-ish complete button, has a marco attached to it that changes cells and has a built in error when you try to change a yellow cell. I can't seem to reverse the logic and create a macro that only allows changes to the yellow cells and won't allow changes to non-yellow cells.

Can someone please take a look at what I have currently and help me out with my problem.

Thanks,
Zach
 

Attachments

  • NEW Community Start File.xlsm
    123.6 KB · Views: 2
Hi Zach.
Good luck with fighting back against management...until then, here's your macro for the yellow completion.
Code:
Sub YellowJob_Complete()
'
' Job_Complete Macro
' Job Complete; created by Zach Prilliman 10/11/13
'
 
'
     With Selection.Interior
        'Just change the equal to a not equal comparison
        If .Color <> vbYellow Then
            'Can't change yellow cells
            MsgBox "Can't touch this.", vbOKOnly + vbCritical, "Hammer Time"
            Exit Sub
        End If
 
    End With
    'Do we just want to make them bold?
    Selection.Font.Bold = True
 
End Sub
 
@Zach
Hi!
Management shouldn't be fought, either you succeed and beat it, others would enjoy the new times, more than you, if you do.
Instead of that support it and push it higher, maybe sometime it'll hit his ceiling and explode or come down slowly as a deflated balloon; then maybe you'd take its place.
Remember that the world belongs to the brave but are cowards who enjoy it.
Regards!
PS: It's noted that I read again Maquiavelo's The Prince and a bit of Jean Armand du Plessis' history (Richelieu, pour la galerie)?
 
Hi Zach.
Good luck with fighting back against management...until then, here's your macro for the yellow completion.
Code:
Sub YellowJob_Complete()
'
' Job_Complete Macro
' Job Complete; created by Zach Prilliman 10/11/13
'
 
'
    With Selection.Interior
        'Just change the equal to a not equal comparison
        If .Color <> vbYellow Then
            'Can't change yellow cells
            MsgBox "Can't touch this.", vbOKOnly + vbCritical, "Hammer Time"
            Exit Sub
        End If
 
    End With
    'Do we just want to make them bold?
    Selection.Font.Bold = True
 
End Sub
Ha this was easier that what I figured out. I actually just re wrote the "can't change yellow" macro and changed the color specifications.

but I appreciate the help.

Is there a good place that I can go to really learn or begin to understand VBA Language? I really have no knowledge of these processes. I can review what you all write and break it down to understand what is going on but I struggle trying to reproduce anything functional.
 
Hi, Zach!
And what about at this place? I wouldn't be fair and impartial speaking about it goodness, but here you have the Ninja team and a group of active members that are really amazing (exception made of that whose nick starts with S and ends with 7).
Checked this?
http://chandoo.org/wp/excel-vba/
http://chandoo.org/wp/vba-classes/
Regards!

@r1c1
Hi!
Don't forget my 15%, and don't tell me your usual "it's already in the mail...", Hui's still waiting for his Diamond card.
Regards!
 
Back
Top