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
Por maquisuelsolidade
Posts
#11168
Boa noite pessoal!

Além de salvar a porcentagem na plan 2 de acordo com o mês, gostaria de salvar ao mesmo tempo a situação e sua porcentagem na plan 3. Já existe o código em vba para salvar na plan 2, só estou querendo adicionar o novo código na mesma macro para salvar na plan3, de acordo com o mês.

Os campos para onde gostaria que os dados ficassem salvos estão destacados por cores.....

grato,
Avatar do usuário
Por alexandrevba
Avatar
#11186
Bom dia!!

Seria algo assim?
Código: Selecionar todos
Sub AleVBA_2222()
Dim sh1 As Worksheet, sh2 As Worksheet, fn As Range
Set sh1 = Sheets("CEL 24")
Set sh2 = Sheets("Plan3")

With sht1
    [G20].Value = [I11].Value
    [H20].Value = [E14].Value
End With

Set fn = sh2.Range("A:A").Find(sh1.Range("H11").Value, LookIn:=xlValues, LookAt:=xlWhole)
    If Not fn Is Nothing Then
        sh1.Range("G20").copy fn.Offset(0, 3)
        sh1.Range("H20").copy fn.Offset(0, 2)
        sh1.Range("G20:H20").ClearContents
    End If
End Sub
Obs: Não liguei as duas macros, mas você pode chamar um dentro da outra usando comando Call

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