Basic VBA Question about Sheets, Ranges, Selection

mvervair

New Member
Joined
Aug 3, 2016
Messages
27
Ok, I've been trying to understand this but right now I'm stuck. This is the piece of code I've been trying to run to copy / paste
Code:
Sheets("job_tracking").Range("C1").Select
However, this does not work.

Instead I wind up using this:
Code:
Sheets("job_tracking").Select
    Range("C1").Select
    Selection.End(xlDown).Select
    Selection.Offset(1, 0).Select
    Selection.PasteSpecial
My confusion is coming from my (lack of) understanding about how objects work. I'm thinking I should be able to access the properties and methods of objects. So to access cells of a page I should be able to use Workbook.Worksheet.Range.Copy format, right? Obviously not, but this is where I'm coming from.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
You should be abe to use Workbook.Worksheet.Range.Copy to copy cells and you should be able to do it without using Select/Selection.

What range do you want to cop and where do you want to copy it to?
 
Upvote 0
Thanks for responding Norie.

Here is the actual code below, it does work for copying. Shouldn't it also work the same way for the pastespecial method?

Code:
Sheets("data_valid").Range("J2").Copy
    Sheets("job_tracking").Select
    Range("C1").Select
    Selection.End(xlDown).Select
    Selection.Offset(1, 0).Select
    Selection.PasteSpecial _
    Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
 
Upvote 0
How is it not working?

Does this work?
Code:
Sheets("data_valid").Range("J2").Copy
Sheets("job_tracking").Range("C1").End(xlDown).Offset(1).PasteSpecial _
    Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
 
Upvote 0

Forum statistics

Threads
1,215,278
Messages
6,124,021
Members
449,139
Latest member
sramesh1024

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top