Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default get part of a file name from a cell value for use in a macro

I figured out the problem, I needed Range("A1") instead of Cells(1, 1)...
It works now. I appreciate all your help. Thanks a Bunch...

"Dave Peterson" wrote:

If x is numeric, then maybe:

windows(format(x,"000") & "_....



Amethyst wrote:

tried that, it keeps stoping at " Windows(x & "_122005
worksheet.xls").Activate ", I put the x= line before the activation of the
first file because x's value is on sheet2 of the second file which is also
the active file but not the active sheet when the macro is run.
any more ideas.. appreciate your help

x = Sheets("sheet2").Cells(1, 1).Value
Windows("sample_1205.xls").Activate
Range("A4:C20").Select
Selection.Copy
Windows(x & "_122005 worksheet.xls").Activate
Range("H4").Select
ActiveSheet.Paste
Range("H3").Select

"Bob Phillips" wrote:

Typo

Windows(x & "_122005 worksheet.xls").Activate



--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Dave" wrote in message
ups.com...
x = Cells(1, 1).Value

Windows(" & x & "_122005 worksheet.xls").Activate





--

Dave Peterson

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
Macro to change part of cell Amy Excel Discussion (Misc queries) 2 August 2nd 07 12:43 PM
macro to move part of cell contents to another cell icetoad hisself Excel Discussion (Misc queries) 4 November 27th 06 07:19 PM
excel - create a macro to use cell text as part of a file name bossman tv New Users to Excel 1 June 27th 06 10:38 PM
Using macro to copy a part of a cell content to next cell Charles Excel Discussion (Misc queries) 6 May 31st 06 05:57 AM
Reference a cell as part of a file name yobrokerboy Excel Programming 13 December 26th 05 09:45 PM


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