Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Find the other workbooks name

hi
here is code that will assign the other workbook name to a variable call wbn.
this will work if you have ONLY 2 workbooks open. if you have a personal or
addin open also, then this will give you problems.
Sub listwb()
Dim wb As Workbook
Dim wbn As String
For Each wb In Application.Workbooks
If wb.Name < ThisWorkbook.Name Then
wbn = wb.Name
MsgBox wbn 'test purposes only
End If
Next wb
End Sub

regards
FSt1

"MarkS" wrote:

Hi,
I have two workbooks open to find the first workbooks name I use
ThisWorkBook.Name to problem is to find the other workbooks name. I need to
copy some data from the second workbook to the first workbook, the name of
the second workbook always changes

Thanks

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
find and replace in workbooks Glenn New Users to Excel 0 December 14th 05 06:16 PM
find same amount in different workbooks Debbie Excel Worksheet Functions 1 November 15th 05 11:07 PM
using find in 2 or 3 workbooks that are open Debbie S Excel Discussion (Misc queries) 1 September 13th 05 12:41 AM
find open workbooks Costas[_2_] Excel Programming 1 September 24th 04 02:43 PM
find workbooks with macros Mike Molyneaux Excel Programming 0 June 4th 04 09:55 PM


All times are GMT +1. The time now is 03:39 PM.

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"