5/23/2015

Tentativas....

Tentando configurar macro






Sub Macro1()
'
' Macro1 Macro
'

Do While ActiveCell.Value <> ""

    Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$A$2<HOJE()"
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .ThemeColor = xlThemeColorAccent4
        .TintAndShade = 0.799981688894314
    End With
    Selection.FormatConditions(1).StopIfTrue = False

ActiveCell.Offset(1, 0).Select

Loop


End Sub

---------------------------------------------------------------------------------------------------------------------------

Sub Macro1()

Dim linha As Integer
Dim datas As String '1º mesa
Dim resto As String '2º status

linha = 2

data = "A2:B2"
outros = b








Do While ActiveCell.Value <> ""

'While Sheets("Plan1").Range("B" & linha).Value

'resto = Sheets("plan1").Range("B" & linha).Value
'datas = Sheets("plan1").Range("a" & linha).Value



    Range("data").Select
    With Selection.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .Color = 49407
        .TintAndShade = 0
        .PatternTintAndShade = 0
    End With

'linha = linha + 1
ActiveCell.Offset(1, 0).Select

'Wend
Loop


End Sub

--------------------------------------------------------------------------------------------------------------------------


ultimo código


Sub Macro1()

Dim linha As Integer
Dim datas As String '1º mesa
Dim resto As String '2º status

linha = 2




Do While ActiveCell.Value <> ""

'While Sheets("Plan1").Range("B" & linha).Value

'resto = Sheets("plan1").Range("B" & linha).Value
'datas = Sheets("plan1").Range("a" & linha).Value



    Range("A" & linha).Select
    With Selection.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .Color = 49407
        .TintAndShade = 0
        .PatternTintAndShade = 0
 
 
    End With


ActiveCell.Offset(1, 0).Select
linha = linha + 1
'Wend
Loop


End Sub


-----------------------------------------------------------------------------------
'deu certo

Sub Macro2()

Dim linha As Integer

linha = 2


Do While ActiveCell.Value <> ""

    Range("A" & linha & ":" & "B" & linha).Select
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$A$2>HOJE()"
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .Color = 255
        .TintAndShade = 0
    End With
    Selection.FormatConditions(1).StopIfTrue = False

linha = linha + 1

Loop


End Sub
Sub Macro3()
'
' Macro3 Macro
'

'
    Range("A2,D2").Select
    Range("D2").Activate
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$A$2<HOJE()"
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    Selection.FormatConditions(1).StopIfTrue = False
End Sub

Nenhum comentário:

Postar um comentário