Reactivate Sheet after Copy to Current Cell

grady121

Active Member
Joined
May 27, 2005
Messages
387
Office Version
  1. 2016
Platform
  1. Windows
Hi, I’m using a User form with several Optionbutton’s to copy a specific range of 7 adjacent cells in a Row, into an active cell.

Once done, I wanted it to select the same active cell again.
Each Optionbutton on the Userform selects a different range to copy into the active cell.



Code:
If UserForm1.OptionButton1.Value = True Then

Range("AA14:AG14").Copy

Application.CutCopyMode = False

Range("A1").Select ‘ This line doesn’t work

End If



The problem I’m having is that the copied range remains highlighted after running the macro and I can’t get it to select another cell on the sheet. I.e. make the sheet active again without manually clicking into another cell, which I’m trying to avoid. Currently, I’m just using the bottom line to try and activate cell “A1”, but it doesn’t respond!



Any help appreciated.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi, I’m using a User form with several Optionbutton’s to copy a specific range of 7 adjacent cells in a Row, into an active cell.

Once done, I wanted it to select the same active cell again.
Each Optionbutton on the Userform selects a different range to copy into the active cell.



Code:
If UserForm1.OptionButton1.Value = True Then

Range("AA14:AG14").Copy

Application.CutCopyMode = False

Range("A1").Select ‘ This line doesn’t work

End If



The problem I’m having is that the copied range remains highlighted after running the macro and I can’t get it to select another cell on the sheet. I.e. make the sheet active again without manually clicking into another cell, which I’m trying to avoid. Currently, I’m just using the bottom line to try and activate cell “A1”, but it doesn’t respond!



Any help appreciated.
Try:

VBA Code:
ActiveSheet.Range("AA14:AG14").Select
Selection.Copy
ActiveSheet.Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False

Regards,
GB
 
Upvote 0
Thanks to all for looking in. I have gone with the following which meets my needs.

Code:
Dim c As Range
Set c = ActiveCell

    If UserForm1.OptionButton1.Value = True Then 
        Range("AA14:AG14").Copy
        Application.CutCopyMode = False
        c.Select
    End If

Thanks again
 
Upvote 0

Forum statistics

Threads
1,225,609
Messages
6,185,982
Members
453,333
Latest member
BioCoder84

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