Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MERGING CELLS WITHOUT LOOSING DATA IN THE SECOND CELL | Excel Discussion (Misc queries) | |||
update cell without loosing previous data | Excel Discussion (Misc queries) | |||
Text and dates into one cell without loosing date format | Excel Discussion (Misc queries) | |||
print only selected cell contents without loosing spread sheet for | Excel Discussion (Misc queries) | |||
Odd problem - loosing cell information | Excel Discussion (Misc queries) |