¿Macro como buscar títulos que no siempre existen?
He intentado buscar la respuesta en otros foro y aunque hay similares aun me me sirve del todo. Soy novato en el tema de macros(lo que hago es buscar, grabar y adaptar) así que gracias de ante manos por la ayuda.
Tengo el código anexo, que cuando están todos los títulos funciona correctamente. La falla es cuando no existe alguno de los títulos deja de ejecutar el resto de comando que están por delante. No genera error pero no realiza la función de buscar el resto de titulo y copiar en otra hoja la columna donde encontró el titulo
Codigo
Sheets("BD ANALITIY"). Activate
With Range("1:1")
Set d = .Find("TELEFONO_CELULAR", LookIn:=xlValues, LookAt:=xlWhole)
If Not d Is Nothing Then
d.Activate
Selection.EntireColumn.Copy
Sheets("UNIFICADOR DE BASES").Select
Range("A1").Select
ActiveSheet.Paste
Else
End
End If
End With
Sheets("BD ANALITIY").Activate
With Range("1:1")
Set d = .Find("CLIENTE_ID", LookIn:=xlValues, LookAt:=xlWhole)
If Not d Is Nothing Then
d.Activate
Selection.EntireColumn.Copy
Sheets("UNIFICADOR DE BASES").Select
Range("B1").Select
ActiveSheet.Paste
Else
End
End If
End With
Sheets("BD ANALITIY").Activate
With Range("1:1")
Set d = .Find("DEPARTAMENTO", LookIn:=xlValues, LookAt:=xlWhole)
If Not d Is Nothing Then
d.Activate
Selection.EntireColumn.Copy
Sheets("UNIFICADOR DE BASES").Select
Range("E1").Select
ActiveSheet.Paste
Else
End
End If
End With
End Sub