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 Ale74
Posts
#13956
Boa tarde.

Tenho uma planilha onde coloco uma quebra de página todas vez que o registro na coluna B altera.

Como poderia fazer no VBA para que isto se torne automático.

1 xxx we
1 xxx we
1 xxx we
1 xxx we
1 xxx we
1 xxx we
1 xxx we
2 yyy rr
2 yyy rr
2 yyy rr
2 yyy rr
2 yyy rr
2 yyy rr
2 yyy rr
3 zzz kk
3 zzz kk
3 zzz kk
3 zzz kk
3 zzz kk
3 zzz kk
3 zzz kk
4 a uu
4 a uu
4 a uu
4 a uu
4 a uu
4 a uu


Desde já agradeço a atenção
Avatar do usuário
Por gfranco
Avatar
#13957
Boa tarde.
Supondo-se que seus códigos comecem em "B1"...
Sub insere_quebra_pagina()
On Error Resume Next

Application.ScreenUpdating = False


ActiveSheet.Range("b1").Select


Do While ActiveCell.Value <> ""

If ActiveCell.Value <> ActiveCell.Offset(-1).Value Then

ActiveSheet.HPageBreaks.Add before:=ActiveCell


End If

ActiveCell.Offset(1).Select

Loop
Application.ScreenUpdating = True
End Sub
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