Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Loosing Cell Selection

In excel, I selected a cell or range of cells to copy, and
they highlighted, I have code that runs on OnKey event.
This code changes the color of a few cells.
Because of the coding for coloring the selection of cells
for copy are lost. Is there a way to preserve the original
cells from loosing focus and selection?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Loosing Cell Selection

Nick: Let's see your code...

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Nick" wrote in message
...
In excel, I selected a cell or range of cells to copy, and
they highlighted, I have code that runs on OnKey event.
This code changes the color of a few cells.
Because of the coding for coloring the selection of cells
for copy are lost. Is there a way to preserve the original
cells from loosing focus and selection?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Loosing Cell Selection

Nick

Set myRange = Selection
' do your thing

myRange.Select

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Nick" wrote in message
...
In excel, I selected a cell or range of cells to copy, and
they highlighted, I have code that runs on OnKey event.
This code changes the color of a few cells.
Because of the coding for coloring the selection of cells
for copy are lost. Is there a way to preserve the original
cells from loosing focus and selection?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Loosing Cell Selection

In 99% of the cases you don't have to move, select, activate anything at all, leaving your
current location intact and your operations invisible.

Run this in a 3-or-more sheet empty workbook, Sheet1 active, some cell selected:

Sub test()
Sheets(2).Range("C3:D6").Interior.ColorIndex = 3
Sheets(3).Range("C12").Value = "Kilroy was here"
Sheets(3).Range("C12").Interior.ColorIndex = 19
Sheets(3).Range("C12").Copy Sheets(2).Range("A1")
Sheets(2).Range("A2").Value = "You ran me from " & _
ActiveSheet.Name & "!" & Selection.Address
End Sub

All changes are in sheets 2 and 3.
--
HTH. Best wishes Harald
Followup to newsgroup only please.

"Nick" wrote in message
...
In excel, I selected a cell or range of cells to copy, and
they highlighted, I have code that runs on OnKey event.
This code changes the color of a few cells.
Because of the coding for coloring the selection of cells
for copy are lost. Is there a way to preserve the original
cells from loosing focus and selection?




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
MERGING CELLS WITHOUT LOOSING DATA IN THE SECOND CELL kalyan Excel Discussion (Misc queries) 2 June 18th 08 08:28 AM
update cell without loosing previous data Susan Excel Discussion (Misc queries) 2 February 26th 07 05:00 AM
Text and dates into one cell without loosing date format Hazeltine Excel Discussion (Misc queries) 2 April 25th 06 07:05 PM
print only selected cell contents without loosing spread sheet for Anna Tozier Excel Discussion (Misc queries) 1 September 16th 05 05:22 PM
Odd problem - loosing cell information Ted Excel Discussion (Misc queries) 5 March 19th 05 01:09 AM


All times are GMT +1. The time now is 06:05 PM.

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

About Us

"It's about Microsoft Excel"