Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel 2007 - cannot get worksheet change macro to work
Can anyone tell me why this VBA doesn't work? - i'm sure i have
managed to trigger macros before with the top code but it doesn't seem to work now. I have a data feed which updates 16 columns in excel (alternatively if i turn off the data feed, am i right in thinking the top code should run if i highlighted 16 columns and pressed delete?) In the code window for the sheet to which the data is going, i have the following: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Columns.Count < 16 Then Exit Sub Application.EnableEvents = False Run "CopyRtoZ" Application.EnableEvents = True End Sub In Module1 i have: Sub CopyRtoZ() ' ' CopyRtoZ Macro ' Range("R5:R6").Select Selection.Copy Range("Z5").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False End Sub I don't understand why the above does not trigger a copy R5 and R6 to Z5 and Z6. I know very little about VBA, i am using Excel 2007 and saving as a .xlsm file as this is what it tells me to do. The security options i can find are all on low. thanks for any help. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
change direction worksheet excel 2007 right to left | Excel Discussion (Misc queries) | |||
why doesn't this simple macro work in excel 2007? | Excel Discussion (Misc queries) | |||
Worksheet.Change macro doesn't run in 2007 | Excel Programming | |||
Macro work in Excel 2003 but not Excel 2007 | Excel Programming | |||
Excel 2007 macro does not work | Excel Programming |