Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default how do get rid of a selection after pasting

Hello everybody,

this is part of my code:
....
......
With Worksheets("Sheet1").Cells
.Copy
.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End With
......
....

the code copies all cells of an (inactive) worksheet and pastes the
values back onto the worksheet, so that there are no formulas left
anymore.

When I return to that particular sheet, I can still see that all the
cells are selected.

How can I get rid of the selection?
I want the selected cell to be A1, but adding code for selecting cell
A1 did not help.

Please help.

Regards,
Norbert


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default how do get rid of a selection after pasting

Hi Norbert,

Add

Application.CutCopyMode = False

after the Paste

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel

"Orion" wrote in message
...
Hello everybody,

this is part of my code:
...
.....
With Worksheets("Sheet1").Cells
.Copy
.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End With
.....
...

the code copies all cells of an (inactive) worksheet and pastes the
values back onto the worksheet, so that there are no formulas left
anymore.

When I return to that particular sheet, I can still see that all the
cells are selected.

How can I get rid of the selection?
I want the selected cell to be A1, but adding code for selecting cell
A1 did not help.

Please help.

Regards,
Norbert




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default how do get rid of a selection after pasting

Hi Niek,

I have tried that as well. I know what it does. It just takes that
flickering frame from the cells, but the cells themselves are still
selected.

Regards,
Norbert


On Fri, 4 Feb 2005 12:58:17 +0100, "Niek Otten"
wrote:

Hi Norbert,

Add

Application.CutCopyMode = False

after the Paste


Kind Regards,

Niek Otten

Microsoft MVP - Excel



"Orion" wrote in message
...
Hello everybody,

this is part of my code:
...
.....
With Worksheets("Sheet1").Cells
.Copy
.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End With
.....
...

the code copies all cells of an (inactive) worksheet and pastes the
values back onto the worksheet, so that there are no formulas left
anymore.

When I return to that particular sheet, I can still see that all the
cells are selected.

How can I get rid of the selection?
I want the selected cell to be A1, but adding code for selecting cell
A1 did not help.

Please help.

Regards,
Norbert


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default how do get rid of a selection after pasting

Application.ScreenUpdating = False
With Worksheets("Sheet1").Cells
.Activate
set rng = Selection
.Copy
.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
rng.Select
End With
Application.ScreenUpdating = True

or just

With Worksheets("Sheet1").UsedRange
.formulas = .Values
End With

--
Regards,
Tom Ogilvy


"Orion" wrote in message
...
Hi Niek,

I have tried that as well. I know what it does. It just takes that
flickering frame from the cells, but the cells themselves are still
selected.

Regards,
Norbert


On Fri, 4 Feb 2005 12:58:17 +0100, "Niek Otten"
wrote:

Hi Norbert,

Add

Application.CutCopyMode = False

after the Paste


Kind Regards,

Niek Otten

Microsoft MVP - Excel



"Orion" wrote in message
...
Hello everybody,

this is part of my code:
...
.....
With Worksheets("Sheet1").Cells
.Copy
.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End With
.....
...

the code copies all cells of an (inactive) worksheet and pastes the
values back onto the worksheet, so that there are no formulas left
anymore.

When I return to that particular sheet, I can still see that all the
cells are selected.

How can I get rid of the selection?
I want the selected cell to be A1, but adding code for selecting cell
A1 did not help.

Please help.

Regards,
Norbert




  #5   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 234
Default how do get rid of a selection after pasting

Orion,

The following two lines of code work for me. Rob

Application.CutCopyMode = False
Range("A1").Select


"Orion" wrote in message
...
Hi Niek,

I have tried that as well. I know what it does. It just takes that
flickering frame from the cells, but the cells themselves are still
selected.

Regards,
Norbert


On Fri, 4 Feb 2005 12:58:17 +0100, "Niek Otten"
wrote:

Hi Norbert,

Add

Application.CutCopyMode = False

after the Paste


Kind Regards,

Niek Otten

Microsoft MVP - Excel



"Orion" wrote in message
...
Hello everybody,

this is part of my code:
...
.....
With Worksheets("Sheet1").Cells
.Copy
.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End With
.....
...

the code copies all cells of an (inactive) worksheet and pastes the
values back onto the worksheet, so that there are no formulas left
anymore.

When I return to that particular sheet, I can still see that all the
cells are selected.

How can I get rid of the selection?
I want the selected cell to be A1, but adding code for selecting cell
A1 did not help.

Please help.

Regards,
Norbert






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pasting a Selection as a Picture [email protected] Links and Linking in Excel 3 February 7th 07 01:10 PM
Pasting Selection In First Blank Row tnederlof Excel Discussion (Misc queries) 5 February 6th 07 10:38 PM
pasting formulas into a selection Frank Kabel Excel Worksheet Functions 3 October 30th 04 06:07 AM
pasting formulas into a selection greg Excel Programming 3 October 29th 04 06:28 PM
pasting selection to end of workbook? joshashcraft Excel Programming 1 August 27th 03 11:09 PM


All times are GMT +1. The time now is 04:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"