NessPJ
Active Member
- Joined
- May 10, 2011
- Messages
- 431
- Office Version
- 365
Hey all,
I have a piece of code where i determine the last row in a sheet and use this value to make a selection, to copy this range to another sheet.
For some reason i can't explain the wrong selections keeps being made.
I made a screenshot to show whats going wrong: Click
(The green square is the selection that keeps being made).
The Range i would want to be selected would be: D6:F10.
The code i am using is here:
I simplified the selection/copy command to see where it all goes wrong..
Before i was using this:
Any help would be very much appreciated!
I have a piece of code where i determine the last row in a sheet and use this value to make a selection, to copy this range to another sheet.
For some reason i can't explain the wrong selections keeps being made.
I made a screenshot to show whats going wrong: Click
(The green square is the selection that keeps being made).
The Range i would want to be selected would be: D6:F10.
The code i am using is here:
Code:
Sheets("Stamgegevens").Select
Lastrow = Range("F65536").End(xlUp).Row
Selection.Range("D6:F" & Lastrow).Copy
Sheets("Kentekenlijst").Select
Range("F3").Select
ActiveSheet.Paste
I simplified the selection/copy command to see where it all goes wrong..
Before i was using this:
Code:
Sheets("Stamgegevens").Select
Lastrow = Range("F65536").End(xlUp).Row
Selection.Range("D6:F" & Lastrow).Copy Destination:=Sheets("Kentekenlijst").Range("F3")
Any help would be very much appreciated!
Last edited: