Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default VBA Excel code not working properly (HELP!)

This is a section of code I have been working on whose purpose is to copy
data from the Timing Maps worksheet, click a hyperlink, and then when the
next file comes up to make a new sheet in the hyperlinked worksheet, paste
the data from the Timing Maps worksheet, and then rename the sheet to
whatever is in cell A1. This code works good up until the hyperlink, once I
get into the hyperlinked document it only pastes 1 cell from the Timing Maps
worksheet and doesn't rename the new worksheet. What I really want this to
do is copy the timing maps worksheet into the new spreadsheet but the problem
is the name of the worksheet has to be created by a concatenated string which
turns into a hyperlink in the earlier part of the code. If someone could
help with a code to open a worksheet whose directory and structure is located
in a cell is what I need. Please help.

Sheets("Timing Maps").Select
Range("AF107").Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("VerificationFormat").Select
Range("E3").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Sheets.Add
Selection.Paste
ActiveSheet.Name = Range("A1").Value
ActiveWorkbook.Close
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default VBA Excel code not working properly (HELP!)

This is what you need to do to open a workbook

Workbooks.Open Filename:= _
"C:\Documents and Settings\Customer\My Documents\Worktime.xls"


"zulfer7" wrote:

This is a section of code I have been working on whose purpose is to copy
data from the Timing Maps worksheet, click a hyperlink, and then when the
next file comes up to make a new sheet in the hyperlinked worksheet, paste
the data from the Timing Maps worksheet, and then rename the sheet to
whatever is in cell A1. This code works good up until the hyperlink, once I
get into the hyperlinked document it only pastes 1 cell from the Timing Maps
worksheet and doesn't rename the new worksheet. What I really want this to
do is copy the timing maps worksheet into the new spreadsheet but the problem
is the name of the worksheet has to be created by a concatenated string which
turns into a hyperlink in the earlier part of the code. If someone could
help with a code to open a worksheet whose directory and structure is located
in a cell is what I need. Please help.

Sheets("Timing Maps").Select
Range("AF107").Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("VerificationFormat").Select
Range("E3").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Sheets.Add
Selection.Paste
ActiveSheet.Name = Range("A1").Value
ActiveWorkbook.Close

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default VBA Excel code not working properly (HELP!)

I need something like this but this doesn't work.

Workbooks.Open Filename:= _
Range("A1").Value _

(The Range contains a hyperlink)

"Barb Reinhardt" wrote:

This is what you need to do to open a workbook

Workbooks.Open Filename:= _
"C:\Documents and Settings\Customer\My Documents\Worktime.xls"


"zulfer7" wrote:

This is a section of code I have been working on whose purpose is to copy
data from the Timing Maps worksheet, click a hyperlink, and then when the
next file comes up to make a new sheet in the hyperlinked worksheet, paste
the data from the Timing Maps worksheet, and then rename the sheet to
whatever is in cell A1. This code works good up until the hyperlink, once I
get into the hyperlinked document it only pastes 1 cell from the Timing Maps
worksheet and doesn't rename the new worksheet. What I really want this to
do is copy the timing maps worksheet into the new spreadsheet but the problem
is the name of the worksheet has to be created by a concatenated string which
turns into a hyperlink in the earlier part of the code. If someone could
help with a code to open a worksheet whose directory and structure is located
in a cell is what I need. Please help.

Sheets("Timing Maps").Select
Range("AF107").Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("VerificationFormat").Select
Range("E3").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Sheets.Add
Selection.Paste
ActiveSheet.Name = Range("A1").Value
ActiveWorkbook.Close

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default VBA Excel code not working properly (HELP!)

You need to put the path and file name into the cell for .Value to contain
the path and file name.

Alternatively, you could use

Workbooks.Open Filename:= _
Range("A1").Hyperlinks(1).Address

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"zulfer7" wrote in message
...
I need something like this but this doesn't work.

Workbooks.Open Filename:= _
Range("A1").Value _

(The Range contains a hyperlink)

"Barb Reinhardt" wrote:

This is what you need to do to open a workbook

Workbooks.Open Filename:= _
"C:\Documents and Settings\Customer\My Documents\Worktime.xls"


"zulfer7" wrote:

This is a section of code I have been working on whose purpose is to
copy
data from the Timing Maps worksheet, click a hyperlink, and then when
the
next file comes up to make a new sheet in the hyperlinked worksheet,
paste
the data from the Timing Maps worksheet, and then rename the sheet to
whatever is in cell A1. This code works good up until the hyperlink,
once I
get into the hyperlinked document it only pastes 1 cell from the Timing
Maps
worksheet and doesn't rename the new worksheet. What I really want
this to
do is copy the timing maps worksheet into the new spreadsheet but the
problem
is the name of the worksheet has to be created by a concatenated string
which
turns into a hyperlink in the earlier part of the code. If someone
could
help with a code to open a worksheet whose directory and structure is
located
in a cell is what I need. Please help.

Sheets("Timing Maps").Select
Range("AF107").Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
Sheets("VerificationFormat").Select
Range("E3").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Sheets.Add
Selection.Paste
ActiveSheet.Name = Range("A1").Value
ActiveWorkbook.Close



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
Text wrap not working properly in Excel Nige1962 Excel Discussion (Misc queries) 1 August 19th 06 12:50 PM
PAGE PREVIEW NOT WORKING PROPERLY IN EXCEL 2007 Scott Dixon Excel Worksheet Functions 0 July 4th 06 03:52 PM
Why is my tab key not working properly any more in Excel? Steelman46 Excel Worksheet Functions 2 February 23rd 06 04:21 PM
Excel ODBC add-in not working properly bromello Setting up and Configuration of Excel 1 February 11th 05 10:26 PM
Replace function not working properly in Excel 2000 SP3 rgbytg Excel Worksheet Functions 5 November 11th 04 03:44 PM


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