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.
#64930
Olá, estou atualizando uma seleção e o nome dela, para essa seleção vir a preencher um combobox de outro formulário posteriormente. Meu problema está na hora de fazer referencia a range desejada. Meu código para isso foi o seguinte.

Dim lrow As Long
lrow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row

Dim iRange2 As Range
Dim Celulas As Range
Set iRange2 = ("A2:Alrow")
For Each Celulas In Range(iRange2)
ws("MPs").Cells(iRange2).Select
Next Celulas
Application.Goto Reference:="MPs"
#64931
Código: Selecionar todos
Sub teste()
 Dim lrow As Long, iRange2 As Range, Celulas As Range
  lrow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
  Set iRange2 = Range("A2:A" & lrow)
  For Each Celulas In iRange2
   'ws("MPs").Cells(iRange2).Select
  Next Celulas
  'Application.Goto Reference:="MPs"
End Sub
#
ou
Código: Selecionar todos
Sub testeV2()
 Dim c As Range
  For Each c In Range("A2:A" & Cells(Rows.Count, 1).End(3).Row)
   'ws("MPs").Cells(iRange2).Select
  Next c
  'Application.Goto Reference:="MPs"
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