Home Excel - Dicas Microsoft Excel VBA Excel VBA - Datas Excel planilha vba datas semanas quantidade semanas no mes e ano

Excel planilha vba datas semanas quantidade semanas no mes e ano

E-mail Imprimir PDF

Saberexcel - site das macros

Exemplo de macro do Aplicativo Microsoft Excel VBA, que inserem fórmulas que contam a quantidade de semanas existentes em determinado ano, como também tráz o total de dias da semana no mes, exemplo: (5) Segundas-Feiras, (4) terças-feiras, e também o total de dias em cada mês.
Essa macro foi feita produzida atraves do GM(Gravador de Macros). Aprenda sobre o GM(Gravador de Macros) em nosso Curso Completo Microsoft Excel VBA

Sub inserir_semanas_meses()
' inserir_semanas_meses Macro
Range("B9").FormulaR1C1 = "=YEAR(TODAY())"
Range("c7") = "Número de dias da Semana, e Meses no ano de " & Range("b9").Value
Range("C9").Select
ActiveCell.FormulaR1C1 = "1/2/1900"
Range("D9").Select
ActiveCell.FormulaR1C1 = "1/3/1900"
Range("E9").Select
ActiveCell.FormulaR1C1 = "1/4/1900"
Range("F9").Select
ActiveCell.FormulaR1C1 = "1/5/1900"
Range("G9").Select
ActiveCell.FormulaR1C1 = "1/6/1900"
Range("H9").Select
ActiveCell.FormulaR1C1 = "1/7/1900"
Range("I9").Select
ActiveCell.FormulaR1C1 = "1/1/1900"
Range("J9").Select
ActiveCell.FormulaR1C1 = "Meses"
Range("C9:I9").Select
Selection.NumberFormat = "ddd"
Range("B10").Select
ActiveCell.FormulaR1C1 = "=DATE(R9C2,ROW(RC)-ROW(R9C2),1)"
Range("C10").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("D10").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("E10").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("F10").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("G10").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("H10").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("I10").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("J10").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-7]:RC[-1])"
Range("B11").Select
Selection.FormulaArray = "=DATE(R9C2,ROW(RC)-ROW(R9C2),1)"
Range("C11").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("D11").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("E11").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("F11").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("G11").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("H11").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("I11").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("J11").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-7]:RC[-1])"
Range("B12").Select
Selection.FormulaArray = "=DATE(R9C2,ROW(RC)-ROW(R9C2),1)"
Range("C12").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("D12").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("E12").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("F12").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("G12").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("H12").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("I12").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("J12").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-7]:RC[-1])"
Range("B13").Select
Selection.FormulaArray = "=DATE(R9C2,ROW(RC)-ROW(R9C2),1)"
Range("C13").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("D13").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("E13").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("F13").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("G13").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("H13").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("I13").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("J13").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-7]:RC[-1])"
Range("B14").Select
ActiveCell.FormulaR1C1 = "=DATE(R9C2,ROW(RC)-ROW(R9C2),1)"
Range("C14").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("D14").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("E14").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("F14").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("G14").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("H14").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("I14").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("J14").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-7]:RC[-1])"
Range("B15").Select
ActiveCell.FormulaR1C1 = "=DATE(R9C2,ROW(RC)-ROW(R9C2),1)"
Range("C15").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("D15").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("E15").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("F15").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("G15").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("H15").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("I15").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("J15").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-7]:RC[-1])"
Range("B16").Select
ActiveCell.FormulaR1C1 = "=DATE(R9C2,ROW(RC)-ROW(R9C2),1)"
Range("C16").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("D16").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("E16").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("F16").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("G16").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("H16").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("I16").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("J16").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-7]:RC[-1])"
Range("B17").Select
Selection.FormulaArray = "=DATE(R9C2,ROW(RC)-ROW(R9C2),1)"
Range("C17").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("D17").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("E17").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("F17").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("G17").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("H17").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("I17").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("J17").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-7]:RC[-1])"
Range("B18").Select
ActiveCell.FormulaR1C1 = "=DATE(R9C2,ROW(RC)-ROW(R9C2),1)"
Range("C18").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("D18").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("E18").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("F18").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("G18").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("H18").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("I18").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("J18").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-7]:RC[-1])"
Range("B19").Select
ActiveCell.FormulaR1C1 = "=DATE(R9C2,ROW(RC)-ROW(R9C2),1)"
Range("C19").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("D19").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("E19").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("F19").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("G19").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("H19").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("I19").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("J19").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-7]:RC[-1])"
Range("B20").Select
Selection.FormulaArray = "=DATE(R9C2,ROW(RC)-ROW(R9C2),1)"
ActiveCell.FormulaR1C1 = "=DATE(R9C2,ROW(RC)-ROW(R9C2),1)"
Range("C20").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("D20").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("E20").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("F20").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("G20").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("H20").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("I20").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("J20").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-7]:RC[-1])"
Range("B21").Select
ActiveCell.FormulaR1C1 = "=DATE(R9C2,ROW(RC)-ROW(R9C2),1)"
Range("C21").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("D21").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("E21").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("F21").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("G21").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("H21").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("I21").Select
Selection.FormulaArray = _
"=SUM((WEEKDAY(DATE(R9C2,MONTH(RC2),ROW(INDIRECT(""1:""&DAY(DATE(R9C2,MONTH(RC2)+1,0))))))=R9C)*1)"
Range("J21").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-7]:RC[-1])"
Range("B22").Select
ActiveCell.FormulaR1C1 = "Numero de:"
Range("C22").Select
ActiveCell.FormulaR1C1 = "1/2/1900"
Range("D22").Select
ActiveCell.FormulaR1C1 = "1/3/1900"
Range("E22").Select
ActiveCell.FormulaR1C1 = "1/4/1900"
Range("F22").Select
ActiveCell.FormulaR1C1 = "1/5/1900"
Range("G22").Select
ActiveCell.FormulaR1C1 = "1/6/1900"
Range("H22").Select
ActiveCell.FormulaR1C1 = "1/7/1900"
Range("I22").Select
ActiveCell.FormulaR1C1 = "1/1/1900"
Range("C23").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-13]C:R[-2]C)"
Range("D23").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-13]C:R[-2]C)"
Range("E23").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-13]C:R[-2]C)"
Range("F23").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-13]C:R[-2]C)"
Range("G23").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-13]C:R[-2]C)"
Range("H23").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-13]C:R[-2]C)"
Range("I23").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-13]C:R[-2]C)"
Range("J23").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-13]C:R[-2]C)"
Range("B10:B21").Select
Selection.NumberFormat = "mmmm"
Range("C22:I22").Select
Selection.NumberFormat = "dddd""s :"""
[b23].Value = "SaberExcel"
Range("B9").Select
End Sub

'Limpar área para o teste.
Sub limpar()
Range("A1:L1000").ClearContents
End Sub

'Com este código acessa o módulo modulo vai para
Sub ver_código()
SendKeys ("%{F11}")
End Sub


Aprenda tudo sobre o Aplicativo Microsoft Excel VBA(Visual Basic Application), sozinho, com baixo custo, praticando com os produtos didáticos Saberexcel

Última atualização em Sáb, 13 de Agosto de 2011 17:38  

Adicionar comentário

"Jamais considere seus estudos como uma obrigação, mas como uma oportunidade invejável para aprender a conhecer a influência libertadora da beleza do reino do espírito, para seu próprio prazer pessoal e para proveito da comunidade." Albert Einstein


Código de segurança
Atualizar

Pesquisa Google SaberExcel

Publicidade Google

Publicidade

Rastreamento Correios

Digite o número do SEDEX conforme o exemplo:
Correios do Brasil

Assinatura SaberExcel

Google Associados

Depoimentos

Visitantes SaberExcel

Excel VBA Estudos®
mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
mod_vvisit_counterHoje3920
mod_vvisit_counterOntem5059
mod_vvisit_counterEsta Semana23426
mod_vvisit_counterSemana passada36487
mod_vvisit_counterEsse mês37155
mod_vvisit_counterMês passado153723
mod_vvisit_counterTodos10459984
Aprenda MS Excel VBA

Adicione Saberexcel Favoritos

 
 

Aprenda tudo sobre o Aplicativo Microsoft Excel VBA

Aprenda tudo sobre o Aplicativo Microsoft Excel VBA(Visual Basic Application), sozinho, com baixo custo, praticando com os produtos didáticos Saberexcel,


   Sobre as WorksheetFunctions Funções de Planilhas que retornam valores do VBA