Ayuda con los codigos de Visual Basic

Iniciado por Luish@o, 2 Enero 2014, 16:47 PM

0 Miembros y 1 Visitante están viendo este tema.

Luish@o

Hola gente saludarles a todos ustedes un gran abrazo y saludo..

Nesecito que me den una manito en esto, estoy programando en Visual Basic y lo q pasa que no me entra en la pantalla del Visual mas codigos... y tengo que bajar mis codigos a otro reglon, pero al bajarlo me sale un error.

Q codigo puedo ponerle para seguir escribiendo si afectar todos los codigos; este es mi codigo:

If Target.Address = rng.Address Or Target.Address = rng1.Address Or Target.Address = rng2.Address Or Target.Address = rng3.Address Then
dato = Target.Value
Target.Value = UCase(dato)
End If
End Sub

Si te fijas en: Target.Address = rng.Address Or Target.Address = rng1.Address Or Target.Address = rng2.Address Or Target.Address = rng3.Address Then

aqui esta el problema se me acaba la pantalla y automaticamente de me baja asi:
If Target.Address = rng.Address Or Target.Address = rng1.Address Or Target.Address = rng2.Address Or Target.Address = rng3.Address Or Target.Address = rng4.Address Or Target.Address = rng5.Address Or Target.Address = rng6.Address Or Target.Address = rng7.Address Or Target.Address = rng8.Address Or Target.Address = rng9.Address Or Target.Address = rng10.Address Or Target.Address = rng11.Address Or Target.Address = rng12.Address Or Target.Address = rng13.Address Or Target.Address = rng14.Address Or Target.Address = rng15.Address Or Target.Address = rng16.Address Or Target.Address = rng17.Address Or Target.Address = rng18.Address Or Target.Address = rng19.Address Or Target.Address = rng20.Address Or Target.Address = rng21.Address Or Target.Address = rng22.Address Or Target.Address = rng23.Address
Or Target.Address = rng23.Address asdasdsadasd Then


Pero me sale un error de color rojo, como puedo bajar; por lo menos tengo que llegar a: Target.Address = rng100.Address Then  sin que salga ese error?
El poder no esta en las armas; sino en el conocimiento.

Luish@o

El Benjo

la tiene fácil. Utiliza el guión bajo para continuar en una nueva línea.

Código (vb) [Seleccionar]

If Target.Address = rng.Address Or Target.Address = rng1.Address Or _
Target.Address = rng2.Address Or Target.Address = rng3.Address Or _
Target.Address = rng4.Address Or Target.Address = rng5.Address Or _
Target.Address = rng6.Address Or Target.Address = rng7.Address Or _
Target.Address = rng8.Address Or Target.Address = rng9.Address Or _
Target.Address = rng10.Address Or Target.Address = rng11.Address Or _
Target.Address = rng12.Address Or Target.Address = rng13.Address Or _
Target.Address = rng14.Address Or Target.Address = rng15.Address Or _
Target.Address = rng16.Address Or Target.Address = rng17.Address Or _
Target.Address = rng18.Address Or Target.Address = rng19.Address Or _
Target.Address = rng20.Address Or Target.Address = rng21.Address Or _
Target.Address = rng22.Address Or Target.Address = rng23.Address Or _
Target.Address = rng23.Address asdasdsadasd Then
www.es.neftis-ai.com

Sí hay un mejor lenguaje de programación y es ese con el que puedes desarrollar tus objetivos.

Luish@o

Gracias man me sirvio de mucho...

Un saludos y gracias por tu ayuda...
El poder no esta en las armas; sino en el conocimiento.

Luish@o

$Edu$

Busca sobre Select Case y Arrays, porque tal vez la proxima puedas optimizar ese codigo con eso..