Ver Mensaje Individual
  #2 (permalink)  
Antiguo 27/03/2007, 14:33
Avatar de abrahamvj
abrahamvj
 
Fecha de Ingreso: julio-2006
Ubicación: Lima, Peru
Mensajes: 708
Antigüedad: 17 años, 9 meses
Puntos: 18
Re: Crear macro, que busque palabra, y la ponga en negrita

Pues no es muyyy dificl, pero hay que darle varias indicaciones:

Sub Buscando()
Dim valor As String, celda1 As String, celda2 As String
Dim inicio As String, largo1 As String
valor = InputBox("Ingrese la palabra a buscar")
largo1 = Len(valor)
Cells.Find(What:=valor, After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate

celda1 = ActiveCell.Address
celda2 = 0

Do While celda2 <> celda1
inicio = InStr(ActiveCell, valor)
With ActiveCell.Characters(Start:=inicio, Length:=largo1).Font
.FontStyle = "Negrita"
End With

Cells.FindNext(After:=ActiveCell).Activate
celda2 = ActiveCell.Address
Loop

End Sub

Abraham