Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can I refer to the ActiveWindow


I my macro I improt data by opening a spreadsheet copying the data ove
and closing it, and therefore flick between workbooks.

This is creating my problems and flicks to the wrong workbook
occasionally.

So I need to tell it to flick back the workbook the marco is in, bu
this workbook changes its name, so I can not say:

Windows(".......").Activate

Is there a way I can at the beginning give the workbook a nam
reference early on in the macro, eg something like:

MacroWorkbook = ActiveWindow

? And then each time I want to flick to this workbook I can refer to i
as:

Windows(MacroWookbook).Activate?

Thank

--
CarolineHedge
-----------------------------------------------------------------------
CarolineHedges's Profile: http://www.excelforum.com/member.php...fo&userid=3570
View this thread: http://www.excelforum.com/showthread.php?threadid=55883

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default How can I refer to the ActiveWindow

ThisWorkbook.Activate
will always activate the workbook in which the macro is located. Is
there a problem with using this?
James

CarolineHedges wrote:
I my macro I improt data by opening a spreadsheet copying the data over
and closing it, and therefore flick between workbooks.

This is creating my problems and flicks to the wrong workbooks
occasionally.

So I need to tell it to flick back the workbook the marco is in, but
this workbook changes its name, so I can not say:

Windows(".......").Activate

Is there a way I can at the beginning give the workbook a name
reference early on in the macro, eg something like:

MacroWorkbook = ActiveWindow

? And then each time I want to flick to this workbook I can refer to it
as:

Windows(MacroWookbook).Activate?

Thanks


--
CarolineHedges
------------------------------------------------------------------------
CarolineHedges's Profile: http://www.excelforum.com/member.php...o&userid=35705
View this thread: http://www.excelforum.com/showthread...hreadid=558831


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default How can I refer to the ActiveWindow

Try

ThisWorkbook.Activate

Regards,
Stefi


€˛CarolineHedges€¯ ezt Ć*rta:


I my macro I improt data by opening a spreadsheet copying the data over
and closing it, and therefore flick between workbooks.

This is creating my problems and flicks to the wrong workbooks
occasionally.

So I need to tell it to flick back the workbook the marco is in, but
this workbook changes its name, so I can not say:

Windows(".......").Activate

Is there a way I can at the beginning give the workbook a name
reference early on in the macro, eg something like:

MacroWorkbook = ActiveWindow

? And then each time I want to flick to this workbook I can refer to it
as:

Windows(MacroWookbook).Activate?

Thanks


--
CarolineHedges
------------------------------------------------------------------------
CarolineHedges's Profile: http://www.excelforum.com/member.php...o&userid=35705
View this thread: http://www.excelforum.com/showthread...hreadid=558831


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can I refer to the ActiveWindow


I knew there must be a really simple way, but I just didn't know what i
was.

Thank yo

--
CarolineHedge
-----------------------------------------------------------------------
CarolineHedges's Profile: http://www.excelforum.com/member.php...fo&userid=3570
View this thread: http://www.excelforum.com/showthread.php?threadid=55883

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveWindow VBA problem Tomasz Klim[_2_] Excel Programming 2 June 11th 06 11:04 PM
Setting ScrollRoll without ActiveWindow [email protected] Excel Programming 1 February 24th 06 12:02 AM
ActiveWindow.SelectedSheets.PrintOut excel-lent Excel Programming 4 June 15th 05 03:48 PM
Problem with using the ActiveWindow property - sometimes Ragnar Midtskogen Excel Programming 1 November 24th 04 02:37 PM
Using ActiveWindow.PointsToScreenPixelsY Pancho Excel Programming 5 February 7th 04 11:23 PM


All times are GMT +1. The time now is 04:15 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"