Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello;
I want to copy & paste the cell data when any cell in the worksheet gets selected. I would like to have the data stored in a list either on the same worksheet or in another worksheet. I have the selected cells background color change when selected but having trouble putting the cells contents into another cell. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rng as Range, rng1 as Range, col as Long set rng = Target(1) cell.Interior.ColorIndex = xlnone rng.Interior.ColorIndex = 5 col = worksheets("sheet2").Cells(1,256).End(xltoleft).co lumn set rng1 = worksheets("sheet2").Cells(rows.count,col).End(xlu p) if not isempty(rng1) then set rng1 = rng1.offset(1,0) if rng1.row 65000 then col = col + 1 set rng1 = Worksheets("Sheet2").Cells(1,col).value end if rng1.value = rng.Value End Sub -- Regards, Tom Ogilvy "dannyboy" wrote in message ... Hello; I want to copy & paste the cell data when any cell in the worksheet gets selected. I would like to have the data stored in a list either on the same worksheet or in another worksheet. I have the selected cells background color change when selected but having trouble putting the cells contents into another cell. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks!!!
Works Great. "Tom Ogilvy" wrote: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim rng as Range, rng1 as Range, col as Long set rng = Target(1) cell.Interior.ColorIndex = xlnone rng.Interior.ColorIndex = 5 col = worksheets("sheet2").Cells(1,256).End(xltoleft).co lumn set rng1 = worksheets("sheet2").Cells(rows.count,col).End(xlu p) if not isempty(rng1) then set rng1 = rng1.offset(1,0) if rng1.row 65000 then col = col + 1 set rng1 = Worksheets("Sheet2").Cells(1,col).value end if rng1.value = rng.Value End Sub -- Regards, Tom Ogilvy "dannyboy" wrote in message ... Hello; I want to copy & paste the cell data when any cell in the worksheet gets selected. I would like to have the data stored in a list either on the same worksheet or in another worksheet. I have the selected cells background color change when selected but having trouble putting the cells contents into another cell. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need help with macro to copy, paste, and clear cell values | Excel Discussion (Misc queries) | |||
copy paste cell with value using macro | Excel Discussion (Misc queries) | |||
Want to use a Macro to copy and paste cell *value* only | Excel Discussion (Misc queries) | |||
Copy and Paste macro needs to paste to a changing cell reference | Excel Programming | |||
create a macro to copy/paste cell data | Excel Programming |