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
#60288
Boa tarde pessoal, estou com um problema nesta planilha na hora de cadastrar , ela demora muito para cadastrar eu desconfio que é por causa das formulas nas celulas G2 , G3, e G5, por que na hora do cadastro ela esta somando a planilha nestas colunas C e D , tem como fazer em vba ou ficar mais rápida porque a minha planilha já esta na linha 1200 e demora muito para fazer o cadastro, este é apenas um exemplo aqui .
Você não está autorizado a ver ou baixar esse anexo.
Editado pela última vez por pasedo em 06 Nov 2020 às 16:14, em um total de 1 vez.
Avatar do usuário
Por AfonsoMira
Posts Avatar
#60290
Experimente trocar o código do botão gravar por este:
Código: Selecionar todos
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
CommandButton1.Enabled = False
'A LINHA A SEGUIR DETERMINA A PLAN1 COMO SELECIONADA
ActiveWorkbook.Sheets("ENTRADAS E SAIDAS").Activate

ultimaLinha = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row 'Procura ultima Linha

If Me.TXTCLIENTE.Value = "" Then
MsgBox "Por favor entre com o nome do cliente.", vbExclamation, "Cadastro."
Me.TXTCLIENTE.SetFocus
Exit Sub
End If
Cells(ultimaLinha + 1, 1).Value = TextBox1.Value
Cells(ultimaLinha + 1, 2) = TXTCLIENTE.Value 'A LINHA A SEGUIR IDENTIFICA QUAL DAS OPÇÕES CRÉDITO OU DÉBITO ESTÁ MARCADA
If OptionButton1.Value = True Then
Cells(ultimaLinha + 1, 3).Value = (CCur(TextBox2.Value))
Else
Cells(ultimaLinha + 1, 4).Value = (CCur(TextBox2.Value))
TextBox3.Text = Plan5.Range("G2")
TextBox4.Text = Plan5.Range("G3")
TextBox5.Text = Plan5.Range("G5")
End If
'AS LINHAS A SEGUIR LIMPAM OS FORMULÁRIOS DEPOIS DE UTILIZADOS
OptionButton1.Value = False
OptionButton2.Value = False
TXTCLIENTE.Value = Empty
TextBox2.Value = Empty
TXTCLIENTE.SetFocus
Application.ScreenUpdating = True
End Sub
pasedo 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