Reputation: 163
Why the code below pastes nothing? It actually copies what I want, but the paste operation doesn´t work.
With Workbooks(NomeAmostra)
Range("B55").Copy
End With
Workbooks("Recuperar (simplificada)").Sheets("DadosProcessados").Activate
Range("AG" & n).PasteSpecial Paste:=xlValues 'Colagem dos resultados
Set Horario = Range("AG" & n)
Horario = Left(Horario, Len(Horario) - 4)
I´ve changed it and now it works just fine, but I don´t understand the reason.
Workbooks(NomeAmostra).Activate
Range("B55").Copy
Workbooks("Recuperar (simplificada)").Sheets("DadosProcessados").Activate
Range("AG" & n).PasteSpecial Paste:=xlValues 'Colagem dos resultados
Set Horario = Range("AG" & n)
Horario = Left(Horario, Len(Horario) - 4)
Thanks!
Upvotes: 2
Views: 155
Reputation: 149325
Because you are missing a DOT before the range object
Change
With Workbooks(NomeAmostra)
Range("B55").Copy
End With
to
With Workbooks(NomeAmostra)
.Range("B55").Copy
End With
Also you might want to see THIS
Upvotes: 2