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: 213
Default Use a Piece of Data for File Name

Hi,

I have a worksheet 1 in a workbook A. I have a code to move the worksheet 1
into a new workbook. I want to name the new workbook using the two pieces of
data from cells A1 and C1 from Workbook A. For example, cells A1 and C1 have
ABC and 123 in Workbook A, respective. Then the new workbook name will be
"ABC123.xls".

How should I reference Cells A1 and C1 in my code in order to name the new
file?

I tried using:

FName1 = Worksheets("1").Range("A1")
FName2 = Worksheets("1").Range("C1")

When I run the code, I got an error message that file "ABC123.xls" can not
be accessed. It didn't save the file, and the new workbook is left open.

Please help. Thanks.
 
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
Extracting single piece of data Louis Excel Discussion (Misc queries) 7 February 9th 06 12:28 AM
Extracting single piece of data Ron Coderre Excel Discussion (Misc queries) 0 February 8th 06 07:51 PM
Extracting single piece of data CLR Excel Discussion (Misc queries) 0 February 8th 06 07:46 PM
macro to import file (help with a piece of code) uriel78 Excel Programming 4 March 12th 05 08:36 AM
Run piece of code for each line of data Diane Alsing Excel Programming 5 February 16th 05 11:23 PM


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