Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
| Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 18th, 2007, 04:32 AM
Registered User
 
Join Date: Apr 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Simple - Quick Answer hopefully!

I am pretty new to VBA, hence simpleness of this question.

Looking to save a copy of a spreadsheet to a particular folder using some cell values in the title, but can't seem to get the syntax of the code right, eg

...\Folder\IainAL & "D8" & "C7" & "I12".xls")

Can anyone help?

Iain

  #2 (permalink)  
Old April 18th, 2007, 05:00 AM
Friend of Wrox
Points: 3,060, Level: 23
Points: 3,060, Level: 23 Points: 3,060, Level: 23 Points: 3,060, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: , , .
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Here you have

Sub Code_For_Iain()

'' ActiveWorkbook.SaveAs "c:\temp\" & "D8" & "C7" & "I12" & ".xls" is wrong

ActiveWorkbook.SaveAs "c:\temp\" & Range("D8").Value & Range("C7").Value & Range("I12").Value & ".xls"

End Sub


http://www.vbadud.blogspot.com
  #3 (permalink)  
Old April 18th, 2007, 05:18 AM
Registered User
 
Join Date: Apr 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Shasur,

Thanks for this, however when I begin the text (C:\,
and then finish it with the &".xls"), I get a warning message saying:

Compile Error

Expected list seperator or )

How do I get round this?

  #4 (permalink)  
Old April 18th, 2007, 05:34 AM
Friend of Wrox
Points: 3,060, Level: 23
Points: 3,060, Level: 23 Points: 3,060, Level: 23 Points: 3,060, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: , , .
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Iain

Can you post the entire line..

Shasur

http://www.vbadud.blogspot.com
  #5 (permalink)  
Old April 18th, 2007, 07:53 AM
Registered User
 
Join Date: Apr 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Shasur,

Got there in the end, thanks for your help.

Iain



Similar Threads
Thread Thread Starter Forum Replies Last Post
i need help quick linkinboy Visual Basic 2005 Basics 11 October 25th, 2007 09:44 PM
Quick Answer PLEASE PLEASE countrymusicman Access VBA 0 April 19th, 2007 02:29 PM
This has to be a simple question to answer. Bill_Thompson Beginning VB 6 1 March 7th, 2006 01:04 PM
Need quick help please! lryckman Access VBA 2 January 12th, 2004 12:55 PM
I'm sure there's a simple answer to this! Jams30 PHP Databases 0 October 27th, 2003 01:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.