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.
#50310
Olá!
Estou fazendo um planilha onde eu inseri um comando para que ela fosse classificada automaticamente em ordem decrescente após alguma alteração na planilha. Porém, depois de classificada em ordem decrescente eu gostaria que a célula ativa fosse a próxima célula vazia no intervalo "H:M" a partir da célula "H3", mas que seguisse a seguinte sequência:
Selecionar a célula "H3" e caso ela não esteja vazia selecionar a próxima célula na mesma linha até a célula "M3" e retorne para a célula "H4" até a "M4" , depois "H5" até a "M5"e assim por diante. Ou seja, procurar a célula vazia na mesma linha e só depois procurar na linha de baixo, mas somente no intervalo das colunas H:M.
Eu usei este comando, mas ele não limita o intervalo "H:M"

Sub Classificar_Ordem_Decrescente()

Range("B2:D62").Select
ActiveWorkbook.Worksheets("Planilha3").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Planilha3").Sort.SortFields.Add2 Key:=Range( _
"D3:D62"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Planilha3").Sort
.SetRange Range("B2:D62")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With

Range("H3").Select ' Selecionar a célula "H3"

While ActiveCell.Value <> "" ' Selecionar a próxima célula vazia na horizontal no campo "RESULTADOS"
ActiveCell.Offset(0, 1).Select

Wend

End Sub
#50311
Código: Selecionar todos
Sub ProcuraCélVazia()
 Dim cv As Range
  Set cv = Range("H2:M100").Find(What:="")
  cv.Select
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