Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
  • Avatar do usuário
  • Avatar do usuário
  • Avatar do usuário
#67872
Tente assim para começar na Coluna A e na linha 1:
Código: Selecionar todos
Sub Aparece_UM()

    Dim Ws     As Worksheet
    Dim lRow   As Long

    Set Ws = Worksheets("Folha1")
    
    lRow = Ws.Cells(Rows.Count, 1).End(xlUp).Row + 1
    If Ws.Cells(lRow - 1, 1) = "" Then
        Ws.Cells(lRow - 1, 1) = 1
    Else
        Ws.Cells(lRow, 1) = 1
    End If
    Set Ws = Nothing
End Sub

Ou assim para começar na coluna A e na linha 2:
Código: Selecionar todos
Sub Aparece_UM()

    Dim Ws     As Worksheet
    Dim lRow   As Long

    Set Ws = Worksheets("Folha1")
    
    lRow = Ws.Cells(Rows.Count, 1).End(xlUp).Row + 1
     Ws.Cells(lRow, 1) = 1

    Set Ws = Nothing
End Sub
AnaGalveias agradeceu por isso
#67896
Tente assim:
Código: Selecionar todos
Sub Aparece_UM_and_Date()

    Dim Ws     As Worksheet
    Dim lRow   As Long

    Set Ws = Worksheets("Folha1")
    
    lRow = Ws.Cells(Rows.Count, 1).End(xlUp).Row + 1
    If Ws.Cells(lRow - 1, 1) = "" Then
        Ws.Cells(lRow - 1, 1) = 1
        Ws.Cells(lRow - 1, 1).Offset(, 1) = Date
    Else
        Ws.Cells(lRow, 1) = 1
        Ws.Cells(lRow, 1).Offset(, 1) = Date
    End If
    Set Ws = Nothing
End Sub

Fica a inserir a data do dia
AnaGalveias, osvaldomp agradeceu por isso
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord