![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: South UK
Posts: 344
|
Hi All
I have code in a worksheet that highlights the entire row when the user selects a cell. However when I try to paste new data to that sheet using a macro the macro fails because of the active worksheet code. Is it possible to suspend the worksheet code whilst another macro is running then re activate it on completion? Many thanks Kevin |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Perth Australia
Posts: 1,567
|
Hi
Yes, you need to put a condition at the beginning of the code such as: If Range("A1").Value = 77 Then (rest of code) End If (add this after your code) Then it will only be active whilst the value of A1 is 77 (or whatever you choose) hope this helps regards Derek |
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
Application.enableevents=false then the rest of your code.... application.enableevents=true ivan |
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Location: Perth Australia
Posts: 1,567
|
Thanks Ivan, that's much neater than mine
regards Derek |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Feb 2002
Location: South UK
Posts: 344
|
Thats fantastic guys many many thanks
Regards Kevin |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|