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 tiagotas
#24939
Tenho uma macro em uma planilha de programação que oculta linhas especificas de uma planilha quando intervalo selecionado está em branco, porém, quando oculto o intervalo do dia 20 ele funciona corretamente, ao ocultar o intervalo do dia 21 ele reexibi o intervalo do dia 20.
Eu preciso ir ocultando diariamente, e no final de semana preciso ocultar 4 dias. Por isso o problema.
Código: Selecionar todos
Sub OcultarLinha20()
  Dim i As Integer
  Application.ScreenUpdating = False
    With Sheets("Simulação")
      .Cells.EntireRow.Hidden = False
          For i = 1526 To 1596
            Select Case .Range("AF" & i).Value
              Case 0
              .Rows(i & ":" & i).EntireRow.Hidden = True
            End Select
         Next i
    End With
    Application.ScreenUpdating = True
End Sub

Sub OcultarLinha21()

  Dim i As Integer
  Application.ScreenUpdating = False
    With Sheets("Simulação")
      .Cells.EntireRow.Hidden = False
          For i = 1602 To 1672
            Select Case .Range("AF" & i).Value
              Case 0
              .Rows(i & ":" & i).EntireRow.Hidden = True
             End Select
         Next i
    End With
    Application.ScreenUpdating = True
End Sub
Cada função é um botão.
#24947
Boa tarde!!

Eu recomendo postar seu arquivo modelo.

Att
#24970
Na Sub Linha20 substitua esta linha
Código: Selecionar todos
 .Cells.EntireRow.Hidden = False
por esta
Código: Selecionar todos
 .Rows("6:76").Hidden = False

Na Sub Linha21 substitua esta linha
Código: Selecionar todos
   .Cells.EntireRow.Hidden = False
por esta
Código: Selecionar todos
 .Rows("82:152").Hidden = False
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