View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
zulfer7 zulfer7 is offline
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