Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy cells
Hi Erik
Try replacing your code with: Private Sub Worksheet_Change(ByVal Target As Range) Dim copyRng As Range Set copyRng = Range("A1:B20") '<<<<<<<<<CHANGE If Not Intersect(Target, copyRng) Is Nothing Then With Worksheets("Sheet2").Range(Target.Address) .Value = Target.Value End With End If End Sub Note that you will need to change the line: Set copyRng = Range("A1:B20") to reflect the range that you want to copy - I've just used a wild guess nonsense range. --- Regards, Norman "Erik" wrote in message ... I have to following sub in my worksheet. Private Sub Worksheet_Change(ByVal Target As Range) With Worksheets("Sheet2").Range(Target.Address) .Value = Target.Value End With End Sub It copies all cell values from sheet1 to sheet2. How do I change this to copy only a selected range of cells. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy Visible Cells in Sheet with Merged and Hidden Cells | Excel Discussion (Misc queries) | |||
How can I copy big ranges of cells without drag or copy/paste? | Excel Discussion (Misc queries) | |||
Copy Source Cells to Destination Cells Only when a Change Occurs | Excel Discussion (Misc queries) | |||
Copy and paste versus copy and insert copied cells | New Users to Excel | |||
Copy/Paste how to avoid the copy of formula cells w/o calc values | Excel Discussion (Misc queries) |