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
#10541
Ao iniciar o userform preciso que ele puche informações da ultima celula da coluna B também da coluna C em variaveis separadas dadas UCD(Ultima célula Data) E UCM(Ultima Célula Mês)

No subscrito setei o w, como o Objeto(Plano), para facilitar formulas. Logo Após o selecionei o plano.
Para setar as ultimas celulas UCD e UCM, sendo assim o meu txtbox tomaria o "UCD.value" para sí(Iniciando com o valor da ultima data)

Código: Selecionar todos

'Variaveis que utilizei em geral
Dim UltDat As Range
Dim Data  As Range 
Dim UC As Range 
Dim w As Worksheet
Dim UCD As Range 
Dim UCM As Range 


txt_nome = "Tcc projeto Official"
TextBoxDate = Date
TextBoxDate.Enabled = False
TextBoxUltDat.Enabled = False
TextBoxUltMes.Enabled = False
TextBoxMes.Enabled = False
TextBoxMes = Format(Now, "mmmm")

'A partir daqui não funciona

Set w = Sheets("RegBackup")
w.Select
Set UCD = w.Range("$B$1000").End(xlUp).Select
Set UCM = w.Range("$C$1000").End(xlUp).Select
TextBoxUltDat = UCD.Value
TextBoxUltMes = UCM.Value

#10542
Desculpe faltou pedaços do código.
Código: Selecionar todos
Private Sub UserForm_Initialize()

Dim UltDat As Range
Dim Data  As Range
Dim UC As Range
Dim w As Worksheet
Dim UCD As Range
Dim UCM As Range

Set w = Sheets("RegBackup")
Set UCD = w.Range("$B$1000").End(xlUp).Select
Set UCM = w.Range("$C$1000").End(xlUp).Select

txt_nome = "Tcc projeto Official"
TextBoxDate = Date
TextBoxDate.Enabled = False
TextBoxUltDat.Enabled = False
TextBoxUltMes.Enabled = False
TextBoxMes.Enabled = False
TextBoxMes = Format(Now, "mmmm")

'A partir daqui não funciona

w.Select
TextBoxUltDat = UCD.Value
TextBoxUltMes = UCM.Value


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