border

Miembros:
Mensajes:
Temas:
Online:

Ultimo Miembro:

 
 

  #1 (permalink)  
Antiguo 06-05-2008, 19:29:13
Un Nuevo Amigo
 
Registrado: ene 2008
Posts: 1
elite19 Valoración +2
Angry copiar un rango variable en otra hoja

intento copiar un rango variable dependiendo de un contador, de una hoja a otra, al copiar, me duplica datos, y no me respeta los rangos a copiar, necesito una mano por favor
Sheets("MATERIALES").Select
if range a2>2 and range a2<93 then
Range("A3:E49").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PRESUPUESTO").Select
Range("I10").Select
if else range a2>93 and range a2 <145 then

Range("A3:E49").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PRESUPUESTO").Select
Range("I10").Select

Range("a49:E75").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PRESUPUESTO").Select
Range("I40").Select
if else range a2>93 and range a2 <145 then

Range("A3:E49").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PRESUPUESTO").Select
Range("I10").Select

Range("a49:E75").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PRESUPUESTO").Select
Range("I40").Select
if else range a2>93 and range a2 <145 then

Range("A3:E49").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PRESUPUESTO").Select
Range("I10").Select

Range("a49:E75").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PRESUPUESTO").Select
Range("I40").Select
if else range a2>93 and range a2 <145 then

Range("A3:E49").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PRESUPUESTO").Select
Range("I10").Select

Range("a49:E75").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PRESUPUESTO").Select
Range("I40").Select
if else range a2>145and range a2 <250 then

Range("A3:E49").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PRESUPUESTO").Select
Range("I10").Select

Range("a49:E75").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PRESUPUESTO").Select
Range("I40").Select

Range("a75:E140").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("PRESUPUESTO").Select
Range("I80").Select

end if
end sub
Responder Con Cita
  #2 (permalink)  
Antiguo 08-05-2008, 16:32:37
Avatar de jcarballo
Buena Participación en el Foro
 
Registrado: abr 2004
Posts: 85
jcarballo Valoración +2
Predeterminado Re: copiar un rango variable en otra hoja

Para comenzar,

1- hay algunos errores de sintaxis:

if range a2>2 and range a2<93 then
Debe ser: if range("a2")>2 and range("a2")<93 then

2- en el código que pones copias varios rangos de celdas pero nunca la pegas en ningún lugar.

3- Otro error de sintaxis:

if else range a2>93 and range a2 <145 then
debe ser: if range("a2")>93 and range("a2")<145 then
__________________
Saludos,

Juan Carlos Carballo Quevedo
Responder Con Cita
Respuesta


Herramientas
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Trackbacks are habilitado
Pingbacks are habilitado
Refbacks are habilitado



La franja horaria es GMT. Ahora son las 18:06:04.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
A vBSkinworks Design

Alojado en el servicio Premium de Masquewebs | Diseño mejorado por MasqueWebs

right