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.
Por Ellen
#64746
Boa noite, pessoal! Estou fazendo um formulario de cadastro e esta dando erro 9 com a funçao listobjects. Me ajudem, por favor

#linha de codigo. Acusando erro na linha em vermelho#

Sub Inserir()

Dim Planilha1 As Worksheet
Dim tabela As ListObject
Dim n As Integer

Set Planilha1 = ActiveWorkbook.Worksheets("Dados gerais")

Set tabela = Planilha1.ListObjects(1)

n = tabela.Range.Rows.Count

MsgBox n

End Sub


Desde ja, agradeço!
Por osvaldomp
#64747
Qual a mensagem de erro ? Existe uma planilha com o nome Dados gerais ? Existe uma Tabela Excel na planilha Dados gerais ?

Experimente mudar o nome da variável Planilha1 para MinhaPlan , por exemplo.

Se não resolver então eu sugiro que você disponibilize diretamente aqui no fórum uma amostra do seu arquivo Excel.
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