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
#27508
Boa noite!
Pessoal,
Adaptei duas macros que encontrei no fórum para copiar imagem e colar no corpo do e-mail e ao mesmo tempo anexar o mesmo arquivo.
A questão é a seguinte: O tamanho do arquivo varia e tem duas Plans. Preciso que a macro copie a área variável e anexe só uma Plan.
A minha macro está copiando uma área definida e anexando todo o arquivo. Alguém pode ajudar?

Desde já, agradeço.

Eudes Militão
Você não está autorizado a ver ou baixar esse anexo.
#27536
Bom dia!!

Segue.
Código: Selecionar todos
Sub AleVBA_5678()
'Fonte:https://www.thespreadsheetguru.com/blog/2014/7/7/5-different-ways-to-find-the-last-row-or-last-column-using-vba
Dim sht As Worksheet
Dim DataRange As Range
Dim LastRow As Long

Set sht = ActiveSheet

LastRow = sht.Cells(sht.Rows.Count, "A").End(xlUp).Row
Set DataRange = Range("A1:G" & LastRow)

DataRange.Copy '...seu código

End Sub
Att
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