Activecell Copy/Paste Syntax

Yamezz

Active Member
Joined
Nov 22, 2006
Messages
365
Office Version
  1. 2019
Guys,

Can I accomplish the following code:

Code:
Range("TotalCost").Copy
Sheets("Programming").Select
ActiveCell.Offset(RowOffset:=0, ColumnOffset:=2).Activate
ActiveCell.Value = Sheets("Operations").Range("TotalCost")
with something like:
Code:
Sheets("Programming").ActiveCell.Offset(0,2) = Sheets("Operations").Range("TotalCost")

Thanks.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
If I follow you correctly, you'll need
If you are already the active cell in "Programming" you dont to refer to the sheet
Code:
ActiveCell.Offset(0, 2) = Sheets("Operations").Range("TotalCost").Value
 
Upvote 0
Thanks Michael. I was thinking I would save processing time by not selecting the Programming sheet, but looks like I have to.

Funny how sometimes it doesn't seem to matter if one has 'redundant' code (such as Sheets("Programming")) and sometime it does...
 
Upvote 0
you don't have to Select the programming sheet !
But with Activecell in the syntax, I assumed you were there !
You need only to refer to a range in Sheets "Programming"....eg..
Rich (BB code):
Sheets("Programming").Range("A1").Offset(0,2).value = Sheets("Operations").Range("TotalCost").value
 
Upvote 0
The trouble is the code steps down a column in a Do While IsEmpty(ActiveCell) = False loop; so I guess to use a Range I would have to have a different kind of loop to step through the list. I imagine it would be more complicated programming than my basic ability. The code goes down the list, uses the value to filter another sheet, then copies the SUBTOTAL values to the same row, but 2 columns over.
 
Upvote 0

Forum statistics

Threads
1,224,271
Messages
6,177,608
Members
452,785
Latest member
3110vba

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