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
Avatar do usuário
Por LeoHenrique
Posts Avatar
#42261
Boa tarde a todos !

Estou tentando fazer que a fórmula na planilha em anexo, reduza a informação até que fique com 10 dígitos, como exemplo = "013113-001", após busque na próxima linha para baixo a próxima referência e faça a mesma fórmula.
Mas não dá certo, ela pula .
Se alguém puder ajudar, agradeço !

Leandro H.M. Moreira
Franca - SP
Você não está autorizado a ver ou baixar esse anexo.
Avatar do usuário
Por LeoHenrique
Posts Avatar
#42268
Pessoal, como estou aprendendo, vou tentando até conseguir, e acabei de fazer o que queria... segue o código, caso alguém sugerir algo diferente ou mais resumido, agradeço !

Sub Atesteloop()

Windows("Miner_produto.xlsx").Activate



Dim Linha As String
Linha = 3
Cells(Linha, 2).Select



While ActiveCell.Value <> "" 'And Linha <= 50000

ActiveCell.Offset(0, -1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=LEFT(RC[1],23)"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=RIGHT(RC[-1],10)"

Linha = Selection.End(xlDown).Select
'Cells(Linha, 2).Select


Wend

Range("C2").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