Jump to content

Recommended Posts

Posted

Boa Tarde,

Tenho o seguinte código...

variavel W declarada como range

nr como integer

LCarrosComp2 é uma label de um form para onde quero enviar o valor da contagem da coluna A, só das celulas preenc.

este código está inserido:

Private Sub UserForm_Initialize()

Dim W as Range

Dim nr as integer

Set W = Worksheets("Carros").Range("A1")

Do While Not IsEmpty(W.Offset(1, 0).Value)

Set R = R.Offset(1, 0)

nr = nr + 1

Loop

LCarrosComp2.Caption = nr.Value

Na folha Carros tenho 20 valores na coluna A...primeira celula(A1) é do titulo Matricula.

Matricula XK-69-41 AU-78-27 EZ-11-84 WK-98-35 CE-41-25 FR-27-99 XD-73-67 EF-25-99 DT-52-92 HG-46-47 AS-31-45 FE-39-26 XU-21-34 GO-01-23 GU-04-29 HX-24-07 LO-12-14 12-14-LO RM-01-01 VB-44-78

A Label apenas me retorna o valor 1, como se só tivesse contado um valor...

Alguém me pode ajudar a resolver esta situação pf?

Obrigado a todos

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.