LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default unselecting or uncopying or whatever in VBA

I'm reasonably proficient in VB6 and Access VBA but am an Excel neophyte so
hopefully you can help me. Here's the scenario:
I do this to unhide some columns:
shtBDA.Columns("A:B").Select
If Selection.EntireColumn.Hidden = True Then
Selection.EntireColumn.Hidden = False
blRehideColumns = True
End If

then I do a bunch of stuff including this sort of thing:
shtBDA.Rows(lngBDAInd).Insert 'insert a new row
shtBDA.Rows(lngBDA_START_ROW).Copy
shtBDA.Rows(lngBDAInd).PasteSpecial

after all that whole bunch of stuff is done I'd like to re-hide the columns
like this:
shtBDA.Columns("A:B").Select
If blRehideColumns Then
Selection.EntireColumn.Hidden = True
End If

but the .Select fails (I reckon) because the Rows...copy has that row
selected. I believe this becauseIt doesn't fail if I Debug and stop
processing, switch back to the sheet and hit escape to deselect the row and
then continue processing.

How can I get that selection cleared from the Rows...copy statement?

Cheers,
Jon




 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Easy question - Unselecting cells None Excel Programming 1 January 1st 07 03:59 PM
Unselecting a Reference Chad Excel Programming 0 January 19th 06 01:39 PM
unselecting not working anymore? Joe Magiera Excel Discussion (Misc queries) 1 September 1st 05 03:35 AM
Selecting / UnSelecting sheets shuvro_basu Excel Discussion (Misc queries) 1 August 22nd 05 02:09 PM
Unselecting a Cell?? Michael Vaughan Excel Programming 2 November 29th 04 11:52 AM


All times are GMT +1. The time now is 06:56 AM.

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

About Us

"It's about Microsoft Excel"