View Single Post
 
Old 09-09-2013, 01:16 AM
SaneMan SaneMan is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Jan 2011
Posts: 20
SaneMan is on a distinguished road
Default

Thanks Bob!

The external sheet references are as follows:

Quote:
='H:\Desktop\[CP Final.xls]c1a'!A20
I tried inserting the code you provided into my macro and it when I ran it a dialogue box comes up saying "Object required". Here's what my macro looks like:

Quote:
Sub newmacro2()
Workbooks.Open ("H:\Desktop\Z1 assessment for CP data_v3.xlsx")
Range("A1:BF85").Select

vf = co.Formula
co.Formula = Left(vf, pr - 1) & Mid(vf, pr) + 2

ThisFile = Range("D1").Value

ActiveWorkbook.SaveAs Filename:="1 " + ThisFile
ActiveWorkbook.Close
End Sub
I didn't think it was likely it'd work after just slotting it in, but as I'm fairly new to this I couldn't really tell what your macro was doing.

Thanks for the help with this. It's much appreciated. Do you know what I should do to make your code work with the rest of my macro?

Last edited by SaneMan; 09-09-2013 at 07:15 AM.
Reply With Quote