Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Select 1 column over

  Asked By: Robert    Date: Nov 19    Category: MS Office    Views: 704
  

I'm trying to select and copy a range in column F based on the number of rows
in column E. I believe I have to use some form of the the Offset property for
this to work but what I've tried isn't working.

Sub copynext()
Dim lastrow As Integer
Range("D21").End(xlDown).Offset(, 1).Select
Range("E21:E" & lastrow).Select
Range("k2").Select
ActiveSheet.Paste
Selection.PasteSpecial (xlPasteAll)

End Sub

Any ideas?

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Aidyn Smith     Answered On: Nov 19

Can you please be more specific?

* Are there any blank cells in column  E?
* Do you need to start from E1 or somewhere down column E?
* Do you need to go to the first blank cell in column E?
* Do you need to select  to the very last populated cell in column E?
* How compare the amount of data between columns E and F?

 
Answer #2    Answered By: Abbad Akhtar     Answered On: Nov 19

As a starter are you looking for something like this?

Sub copynext()
Dim lastrow As Integer
lastrow = Range("D21").End(xlDown).Offset(, 1).Row
Range("E21:E" & lastrow).Copy
Range("k2").Select
'One of the lines below, not both
ActiveSheet.Paste
'Selection.PasteSpecial (xlPasteAll)

End Sub

 
Didn't find what you were looking for? Find more on Select 1 column over Or get search suggestion and latest updates.




Tagged: