copy & paste the column found by Selection.Find

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi and thanks for your help.

This is a one off requirement to speed up my day

Thus far, I have the following code. I'm trying to find a column in the
current active worksheet "US_HK", then copy that column to the next
available column in the "HK" worksheet. To simplify the process I place my
curser in the first cell of the column in "HK" where I want the data pasted
to.

Rows("1:1").Select
Selection.Find(What:="Text1", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=
_
xlNext, MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Select
Columns.Select
Selection.Copy
Sheets("HK").Select
ActiveSheet.Paste

Any help will be apprciated.

Cheers
Mark
 
Try this:-

Rows("1:1").Select
Selection.Find(What:="Text1", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, _
SearchFormat:=False).Activate
ActiveCell.EntireColumn.Select
Selection.Copy
Sheets("HK").Select
ActiveSheet.Paste

Note: You have already activated the cell in the find. No need to select it
again.

Regards,

OssieMac
 
many thanks for your help

OssieMac said:
Try this:-

Rows("1:1").Select
Selection.Find(What:="Text1", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, _
SearchFormat:=False).Activate
ActiveCell.EntireColumn.Select
Selection.Copy
Sheets("HK").Select
ActiveSheet.Paste

Note: You have already activated the cell in the find. No need to select
it
again.

Regards,

OssieMac
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top