Notifications
Clear all

Lançamento de Dados - Próxima linha disponível

5 Posts
2 Usuários
0 Reactions
993 Visualizações
(@chook)
Posts: 197
Reputable Member
Topic starter
 

Amigos, não sei mais o que fazer!!! :? :?

A rotina e simples mas não funciona!!

Ao clicar no botão ele vai identificar o último lançamento e ir a proxima celula disponivel na coluna AU.

Depois vai inserir a data e o saldo inicial que já foi informado!

No entanto ele só está lançando na celula AU2...

Help!!

Private Sub CommandButton2_Click()
Dim UltimaLinha1, i, z As Integer
Sheets("Banco_Sistema").Select
Range("AU1").Select
UltimaLinha1 = Sheets("Banco_Sistema").Cells(Cells.Rows.Count, 46).End(xlUp).Row
UltimaLinha1 = UltimaLinha1 + 1
Range("AU" & UltimaLinha1).Select

If UltimaLinha1 = 2 Then
    ActiveCell.Value = Date
Else
    ActiveCell.Value = Date
End If
    saldo = Application.InputBox("Informe o Saldo Inicial para o dia " & Date, "Saldo Inicial")
    ActiveCell.Offset(0, 1).Value = saldo
End Sub
 
Postado : 20/07/2012 8:29 am
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Sem ver seu modelo fica muito dificil imaginar o porque?
Porem o que me chama atenção é que vc vai aplicar o valor na coluna AU contando as linha de AT, tem valores em AT?

 
Postado : 20/07/2012 8:35 am
(@chook)
Posts: 197
Reputable Member
Topic starter
 

46 não é AU?

 
Postado : 20/07/2012 8:38 am
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Não AU é 47;qdo tiver duvida ou for + dificil obter o numero da linha utiliza seu codigo alfabetico:

Sheets("Banco_Sistema").Cells(Cells.Rows.Count, "AU").End(xlUp).Row

 
Postado : 20/07/2012 8:41 am
(@chook)
Posts: 197
Reputable Member
Topic starter
 

Você ta certo mesmo!! é pra ser 47!!!!!!

 
Postado : 20/07/2012 8:43 am