PC Review


Reply
Thread Tools Rate Thread

code to color cell

 
 
Israel
Guest
Posts: n/a
 
      21st Mar 2007


With the following code i wanted him to shadow me the cell that i
doesn't find with blue color but not you where to place the it lines
of code, I believe that it is placed after the function else i would
thank Them a lot them to help me

Dim Origen As Range, Fila As Integer, Filas As Long
Fila = 8


Busca:
If Worksheets("Automatizacion A5,NB").Range("bi" & Fila) = "" Then
GoTo Salida
On Error Resume Next
With Worksheets("Proc.base")
Set Origen = .Cells.FIND( _
What:=Worksheets("Automatizacion A5,NB").Range("bi" & Fila), _
After:=.Range("bi3"), _
LookAt:=xlWhole)
If Not Origen Is Nothing Then
Origen.Resize(9).EntireRow.Copy _
Destination:=Worksheets("hoja3").Cells(Rows.Count,
"a").End(xlUp).Offset(2)
'Rellenar filas
For Filas = Worksheets("Automatizacion
A5,NB").Cells(Rows.Count, 1).End(xlUp).Row _
To 1 Step -1
Worksheets("Automatizacion A5,NB").Cells(Fila, 62).Copy _
Destination:=Worksheets("Hoja3").Cells(Rows.Count,
5).End(xlUp).Offset(3).Resize(8)
Next
Else
End If
End With
Fila = Fila + 1
GoTo Busca
Salida:
Set Origen = Nothing


End Sub




Dim Origen As Range, Fila As Integer, Filas As Long
Fila = 8


Busca:
If Worksheets("Automatizacion A5,NB").Range("bi" & Fila) = "" Then
GoTo Salida
On Error Resume Next
With Worksheets("Proc.base")
Set Origen = .Cells.FIND( _
What:=Worksheets("Automatizacion A5,NB").Range("bi" & Fila), _
After:=.Range("bi3"), _
LookAt:=xlWhole)
If Not Origen Is Nothing Then
Origen.Resize(9).EntireRow.Copy _
Destination:=Worksheets("hoja3").Cells(Rows.Count,
"a").End(xlUp).Offset(2)
'Rellenar filas
For Filas = Worksheets("Automatizacion
A5,NB").Cells(Rows.Count, 1).End(xlUp).Row _
To 1 Step -1
Worksheets("Automatizacion A5,NB").Cells(Fila, 62).Copy _
Destination:=Worksheets("Hoja3").Cells(Rows.Count,
5).End(xlUp).Offset(3).Resize(8)
Next
Else
End If
End With
Fila = Fila + 1
GoTo Busca
Salida:
Set Origen = Nothing


End Sub

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      21st Mar 2007
Sub testcolor()

Dim Origen As Range, Fila As Integer, Filas As Long
Fila = 8


Busca:
If Worksheets("Automatizacion A5,NB").Range("bi" & Fila) = "" Then
GoTo Salida
End If
' On Error Resume Next
With Worksheets("Proc.base")
Set Origen = .Cells.Find( _
What:=Worksheets("Automatizacion A5,NB").Range("bi" & Fila), _
After:=.Range("bi3"), _
LookAt:=xlWhole)
If Not Origen Is Nothing Then

Origen.Resize(9).EntireRow.Copy _
Destination:=Worksheets("hoja3"). _
Cells(Rows.Count, "a").End(xlUp).Offset(2)
'Rellenar filas

For Filas = Worksheets("Automatizacion A5,NB"). _
Cells(Rows.Count, 1).End(xlUp).Row _
To 1 Step -1
Worksheets("Automatizacion A5,NB").Cells(Fila, 62).Copy _
Destination:=Worksheets("Hoja3"). _
Cells(Rows.Count, 5).End(xlUp).Offset(3).Resize(8)
Next
Else
Worksheets("Automatizacion A5,NB").Range("bi" & Fila). _
Interior.ColorIndex = 5
End If
End With
Fila = Fila + 1
GoTo Busca
Salida:
Set Origen = Nothing


End Sub



"Israel" wrote:

>
>
> With the following code i wanted him to shadow me the cell that i
> doesn't find with blue color but not you where to place the it lines
> of code, I believe that it is placed after the function else i would
> thank Them a lot them to help me
>
> Dim Origen As Range, Fila As Integer, Filas As Long
> Fila = 8
>
>
> Busca:
> If Worksheets("Automatizacion A5,NB").Range("bi" & Fila) = "" Then
> GoTo Salida
> On Error Resume Next
> With Worksheets("Proc.base")
> Set Origen = .Cells.FIND( _
> What:=Worksheets("Automatizacion A5,NB").Range("bi" & Fila), _
> After:=.Range("bi3"), _
> LookAt:=xlWhole)
> If Not Origen Is Nothing Then
> Origen.Resize(9).EntireRow.Copy _
> Destination:=Worksheets("hoja3").Cells(Rows.Count,
> "a").End(xlUp).Offset(2)
> 'Rellenar filas
> For Filas = Worksheets("Automatizacion
> A5,NB").Cells(Rows.Count, 1).End(xlUp).Row _
> To 1 Step -1
> Worksheets("Automatizacion A5,NB").Cells(Fila, 62).Copy _
> Destination:=Worksheets("Hoja3").Cells(Rows.Count,
> 5).End(xlUp).Offset(3).Resize(8)
> Next
> Else
> End If
> End With
> Fila = Fila + 1
> GoTo Busca
> Salida:
> Set Origen = Nothing
>
>
> End Sub
>
>
>
>
> Dim Origen As Range, Fila As Integer, Filas As Long
> Fila = 8
>
>
> Busca:
> If Worksheets("Automatizacion A5,NB").Range("bi" & Fila) = "" Then
> GoTo Salida
> On Error Resume Next
> With Worksheets("Proc.base")
> Set Origen = .Cells.FIND( _
> What:=Worksheets("Automatizacion A5,NB").Range("bi" & Fila), _
> After:=.Range("bi3"), _
> LookAt:=xlWhole)
> If Not Origen Is Nothing Then
> Origen.Resize(9).EntireRow.Copy _
> Destination:=Worksheets("hoja3").Cells(Rows.Count,
> "a").End(xlUp).Offset(2)
> 'Rellenar filas
> For Filas = Worksheets("Automatizacion
> A5,NB").Cells(Rows.Count, 1).End(xlUp).Row _
> To 1 Step -1
> Worksheets("Automatizacion A5,NB").Cells(Fila, 62).Copy _
> Destination:=Worksheets("Hoja3").Cells(Rows.Count,
> 5).End(xlUp).Offset(3).Resize(8)
> Next
> Else
> End If
> End With
> Fila = Fila + 1
> GoTo Busca
> Salida:
> Set Origen = Nothing
>
>
> End Sub
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to copy cell borders and fill color from one cell to another Chuck M Microsoft Excel Programming 4 10th Jan 2008 12:34 PM
code to change color of negative cell jacquelineholliday@gmail.com Microsoft Excel Programming 1 2nd Oct 2007 03:48 PM
Remove Cell Color after Code is Deleted fixedpower@yahoo.com Microsoft Excel Misc 4 20th Feb 2007 07:37 PM
Cell Color Code Website EMoe Microsoft Excel Programming 1 29th May 2005 06:18 AM
Need help troubleshooting code which changes the color of a cell =?Utf-8?B?TGFycnk=?= Microsoft Excel Programming 4 27th Oct 2004 06:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:17 PM.