Hello everyone, I am working on this part of a big code and I am having issues with using .find with mergeArea as I cannot pull out the information and add it into a new sheet. Actually this part of the code can read the value in merged cells (I did an inspection) but it does not pull them out. How can I do this? I would thank very much any help.
Code:
<code> For Each ws In SourceWb.Worksheets
If IsNumeric(Left(ws.name, 3)) Then Set gCell = ws.Columns("F").Find(what:=numdoc, LookIn:=xlValues, lookat:=xlWhole, SearchOrder:=xlByRows, MatchCase:=False, searchformat:=False)
If Not gCell Is Nothing Then
<code>[COLOR=#000000]firstAddress = gCell.Address
contador = contador + 1
ColorIndexOfCF = gCell.Interior.ColorIndex
Do [/COLOR][COLOR=#FF0000]
contactos = gCell.Offset(, 4).MergeArea.Value
comentarios= gCell.Offset(, 5).MergeArea.Value
If IsDate(HojaActiva.Cells(F1, 5).Value) = True Then
HojaNueva.Rows(F2).Interior.ColorIndex = ColorIndexOfCF
End If [/COLOR][COLOR=#000000]
[/COLOR][COLOR=#00ff00]'busca si el valor está repetido y si lo está lo copia seguidamente del comentario [/COLOR][COLOR=#000000]
If Not contactos = "" Then
HojaNueva.Cells(F2, 20).Value = contactos & " ," & HojaNueva.Cells(F2, 20).Value
End If
If Not comentarios = "" Then
HojaNueva.Cells(F2, 21).Value = comentarios & " ," & HojaNueva.Cells(F2, 21).Value
End If
Set gCell = ws.Columns("F").FindNext(gCell)
Loop While Not gCell Is Nothing And gCell.Address <> firstAddress End If End If Next ws Set gCell = Nothing [/COLOR]</code></code>
Last edited: