Macros para copiar datos a otra hoja cumpliendo condiciones y darle formato
"para Dante Amor"
¿Se podría sombrear y quede en negrita las actividades seleccionadas con un color claro y los porcentajes seleccionados también con un sombreado?
¿Si quiero cambiar el destino de la otra hoja a ciertas celdas como podría ser la macros?
como ejemplo: B1, B3, B5 ...
Ultima macros
Sub Copiar()
'Por.Dante Amor
Set h1 = Sheets("Hoja1") 'hoja con datos
Set h2 = Sheets("Hoja2") 'hoja destino
col1 = "E" 'columna con las actividades
col2 = "A" 'columna destino
'
wmin = 9999
For i = 8 To 23 'h1.Range(col1 & Rows.Count).End(xlUp).Row
u = h2.Range(col2 & Rows.Count).End(xlUp).Row + 1
valor = h1.Cells(i, Columns(col1).Column + 3)
Select Case valor
Case Is < 0.8
h1.Cells(i, col1).Font.Bold = True
h2.Cells(u, col2) = h1.Cells(i, col1)
'h2.Cells(u, Columns(col2).Column + 1) = h1.Cells(i, Columns(col1).Column + 1)
Case Is >= 0.8
If valor < wmin Then
fila = i
wmin = valor
End If
End Select
Next
If wmin <> 9999 Then
h1.Cells(fila, col1).Font.Bold = True
u = h2.Range(col2 & Rows.Count).End(xlUp).Row + 1
h2.Cells(u, col2) = h1.Cells(fila, col1)
'h2.Cells(u, Columns(col2).Column + 1) = h1.Cells(fila, Columns(col1).Column + 1)
End If
MsgBox "fin"
End Sub"para Dante Amor"