Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Switching Between Workbooks.

Hi.

I need to switch between worobooks, but i never know the name of one of them.

Dim Nome As Workbook
Set Nome = ActiveWorkbook.FullName

Range("A2").Select
Selection.CurrentRegion.Select
Selection.Copy
Windows("ordenação para folha final.xls").Activate
Sheets("Original 1").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A1").Select

Windows("Nome").Activate
Range("A1").Select

Can anyone help me with this? i can ´t get this to work...
one more thing the code is in another book that is open...

Thansk a lot!!!!!!!!!!!!
SpeeD
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Switching Between Workbooks.

The best way is to get familiar with workbook objects.

dim wbk1 as workbook
dim wbk2 as workbook

set wbk1 = activeworkbook
set wbk2 = workbooks("MyBook.xls")

'the book where the code is running can always be refered to as ThisWorkbook

wbk1.activate
msgbox "You are here'
wbk2.activate
msgbox "Now here"
thisworkbook.activate
msgbox "and back to here"
--
HTH...

Jim Thomlinson


"SpeeD" wrote:

Hi.

I need to switch between worobooks, but i never know the name of one of them.

Dim Nome As Workbook
Set Nome = ActiveWorkbook.FullName

Range("A2").Select
Selection.CurrentRegion.Select
Selection.Copy
Windows("ordenação para folha final.xls").Activate
Sheets("Original 1").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A1").Select

Windows("Nome").Activate
Range("A1").Select

Can anyone help me with this? i can ´t get this to work...
one more thing the code is in another book that is open...

Thansk a lot!!!!!!!!!!!!
SpeeD

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
switching between workbooks Bob Zimski Excel Programming 4 November 25th 08 08:10 PM
Switching between Workbooks Doekoe Excel Discussion (Misc queries) 0 May 5th 08 10:54 AM
Switching between workbooks Fan924 Excel Programming 3 October 11th 07 05:50 AM
Switching between workbooks Jim Excel Discussion (Misc queries) 5 July 28th 07 03:19 AM
Switching Between 2 workbooks using VBA Isit Ears[_2_] Excel Programming 1 October 17th 06 01:33 PM


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