View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
L. Howard L. Howard is offline
external usenet poster
 
Posts: 852
Default A Boolean expression


FYI, I offered this solution to OP and he/she was delighted.


Option Explicit

Sub Cell_Col_L()
Dim rngC As Range

For Each rngC In Selection
rngC.Interior.ColorIndex = IIf(rngC.Interior.ColorIndex = xlNone, _
3, xlNone)
rngC = IIf(rngC = "", "L", "")
Next

End Sub

Sub Cell_Col_M()
Dim rngC As Range

For Each rngC In Selection
rngC.Interior.ColorIndex = IIf(rngC.Interior.ColorIndex = xlNone, _
4, xlNone)
rngC = IIf(rngC = "", "M", "")
Next

End Sub

Sub Cell_Col_N()
Dim rngC As Range

For Each rngC In Selection
rngC.Interior.ColorIndex = IIf(rngC.Interior.ColorIndex = xlNone, _
6, xlNone)
rngC = IIf(rngC = "", "N", "")
Next

End Sub


Where apparently there are several..? users each with their own lil macro for marking and labeling or whatever. The toggle on - off was also a hit.


In the same post I was asked to look at another from OP which had no responses. I did and it is a semi-monster (to me).

I have seen these type format reconfigurations macros, and can never seem to take one and adapt it to a slightly different scenario.

If interested, the format on sheet 1 needs to be transformed to the format shown on sheet two.

Where the Q1, Q2 etc. are listed on sheet 2 only if they have an H, N or R value on sheet 1.

About 1000 rows and the Qn's extend as far as 103 per row. Rows apparently are not all the same number of columns, some 30 column, some 103 and many in between.

https://www.dropbox.com/s/9gok5nqgdz...ster.xlsm?dl=0

I would be a pure messenger on this.

Howard