Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Could anyone suggest why the following doesnt work. Im using it behind
a worksheet to copy down formula but when I ammended it to include copying from A85 to column A it stopped working. It also appears not to copy formatting which I would like it to do. Could anyone make any suggestions? Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Columns(2), Target.EntireColumn) Is Nothing Then Range("A85,AH12:CT12").Copy Intersect(Target.EntireRow, Range("A,AH:CT")) End If End Sub Regards JAmie |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jamie,
I don't think you can copy cells from different rows at the same time... maybe try it this way: Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Columns(2), Target.EntireColumn) Is Nothing Then Application.EnableEvents = False Range("A85").Copy Target.Offset(0, -1) Range("AH12:CT12").Copy Range("AH" & Target.Row) Application.EnableEvents = True End If End Sub -- Hope that helps. Vergel Adriano " wrote: Could anyone suggest why the following doesnt work. Im using it behind a worksheet to copy down formula but when I ammended it to include copying from A85 to column A it stopped working. It also appears not to copy formatting which I would like it to do. Could anyone make any suggestions? Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Columns(2), Target.EntireColumn) Is Nothing Then Range("A85,AH12:CT12").Copy Intersect(Target.EntireRow, Range("A,AH:CT")) End If End Sub Regards JAmie |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to COPY FORMULA BETWEEN RANGES | Excel Discussion (Misc queries) | |||
how copy formula that contains ranges so ranges do not overlap | Excel Worksheet Functions | |||
Copy worksheet values and formats into another workbook | Excel Programming | |||
copy worksheet (keeping formats) | New Users to Excel | |||
Transforming date ranges into discrete dates | Excel Programming |