How to replace Range("A1") with the ActiveCell value

BritsBlitz

New Member
Joined
Jan 10, 2014
Messages
34
Office Version
  1. 365
Platform
  1. Windows
Hi

I am trying to write a very simple code which looks to see if a checkbox is checked, and if it is, it will copy a range of data from one worksheet into another worksheet. The code below works just fine for what I want, except that I’m limited to always starting the paste in cell A1 on the “Sheet2” worksheet. I know how to change the ActiveCell value to any cell in the worksheet, but how do I replace the Range(“A1”) with the ActiveCell value so that the data will be pasted to the ActiveCell, and not always to Cell A1?

If Sheet1.Range("C2").Value = True Then
Sheets("Sheet3").Range("A4:D13").Copy
Sheets("Sheet2").Range("A1").PasteSpecial xlValues
Sheets("Sheet2").Range("A1").PasteSpecial xlFormats
Application.CutCopyMode = False
End If
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
You need to select Sheet2 to do that like this:
Code:
Sheet1.Range("A1").Copy
Sheet2.Select
ActiveCell.PasteSpecial xlValues
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

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