#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 460
Default Help please

I just started using this macro to highlight a particular row that I click on
in a table. Does anyone know why it clears the undo capability? If I make any
changes to my table, I cannot go back.

Const TableRangeAddress As String = "A2:AJ203"
Dim TableRange As Range
On Error GoTo Whoops
Application.ScreenUpdating = False
Set TableRange = Range(TableRangeAddress)
TableRange.Borders.LineStyle = xlLineStyleNone
If Intersect(Target, TableRange) Is Nothing Then Exit Sub
Intersect(Target.EntireRow, TableRange).BorderAround Weight:=xlMedium
Whoops:
Application.ScreenUpdating = True

End Sub
--

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Help please

Doug,

I haven't looked at you code so i assume it's OK but losing the undo stack
when you run a macro is a 'feature' of Excel. You can write a custom undo sub
for your code but it's messy. have a look here.

http://www.j-walk.com/ss/excel/tips/tip23.htm

Mike

"Doug" wrote:

I just started using this macro to highlight a particular row that I click on
in a table. Does anyone know why it clears the undo capability? If I make any
changes to my table, I cannot go back.

Const TableRangeAddress As String = "A2:AJ203"
Dim TableRange As Range
On Error GoTo Whoops
Application.ScreenUpdating = False
Set TableRange = Range(TableRangeAddress)
TableRange.Borders.LineStyle = xlLineStyleNone
If Intersect(Target, TableRange) Is Nothing Then Exit Sub
Intersect(Target.EntireRow, TableRange).BorderAround Weight:=xlMedium
Whoops:
Application.ScreenUpdating = True

End Sub
--

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 460
Default Help please

The code highlights a row that I click on. It doesn't make sense that it
would keep me from being able to undo changes. Also if I need to copy and
paste something, when I click paste, it forgets what I copied. I may just
stop using it. As convenient as it is, It is a problem also.
--

Thanks


"Mike H" wrote:

Doug,

I haven't looked at you code so i assume it's OK but losing the undo stack
when you run a macro is a 'feature' of Excel. You can write a custom undo sub
for your code but it's messy. have a look here.

http://www.j-walk.com/ss/excel/tips/tip23.htm

Mike

"Doug" wrote:

I just started using this macro to highlight a particular row that I click on
in a table. Does anyone know why it clears the undo capability? If I make any
changes to my table, I cannot go back.

Const TableRangeAddress As String = "A2:AJ203"
Dim TableRange As Range
On Error GoTo Whoops
Application.ScreenUpdating = False
Set TableRange = Range(TableRangeAddress)
TableRange.Borders.LineStyle = xlLineStyleNone
If Intersect(Target, TableRange) Is Nothing Then Exit Sub
Intersect(Target.EntireRow, TableRange).BorderAround Weight:=xlMedium
Whoops:
Application.ScreenUpdating = True

End Sub
--

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"