Saberexcel - o site de quem precisa aprender Micrososft Excel VBA
Esse procedimento do Aplicativo Microsoft Excel VBA(Visual Basic Application), formata uma data em célula com auxílio de um objeto CommandButton.
.Value = Left(UCase(MonthName(Month(Date) - 1)), 4) & " " & Year(Date) 'quatro letras 'MARÇ' .Value = UCase(MonthName(Month(Date) - 1)) & " " & Year(Date) .Value = UCase(MonthName(Month(Date) - 1, True)) & " " & Year(Date) .Value = DateSerial(Year(Date), Month(Date), -1)
Private Sub CommandButton1_Click()
If Day(Date) = 11 Then Rows("9").Insert xlShiftDown: Range("G9").Value = Month(Date)
ActiveCell.Value = Application.WorksheetFunction.Proper(ActiveCell.Value) With Range("G9") '. With .Font .Bold = True ' teste negrito .Name = "Arial" .Size = 18 End With 'PODERÁ USAR UMA DAS FORMATAÇÕES ABAIXO '.Value = DateSerial(Year(Date), Month(Date), -1) '.Value = UCase(MonthName(Month(Date) - 1, True)) & " " & Year(Date) '.Value = UCase(MonthName(Month(Date) - 1)) & " " & Year(Date) .Value = Left(UCase(MonthName(Month(Date) - 1)), 4) & " " & Year(Date) 'quatro letras 'MARÇ' .NumberFormat = "mmm - yyyy" End With
End Sub
Aprenda tudo sobre planilhas do Aplicativo Microsoft Excel VBA(Visual Basic Application), sozinho, com baixo custo, praticando com os produtos didáticos Saberexcel
Publicidade Compre com segurança, garantia e ótimos preços
|