Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Defining string using InStr function help


Hello, I'm trying to define a string *Foldernames* based off the name of
the active workbook. An excerp of my code is below but the macro is
using the default string. The worksheet name is Atlas_Daily_PDF. I
can't figure out why this is not recognizing the worksheet and changing
the Foldernames. Any help is greatly appreciated.

Dim Foldernames As String
Foldernames = "C:\"
If InStr(1, ActiveWorkbook.Name, "Atlas") < 0 Then
Foldernames = "L:\CMD\CMD_Risk\Customer
Valuations\Valuation Archives\Atlas\"
End If


I'm basically trying to Save each worksheet in my workbook to PDF
format where the name of the file and location is based off the sheet's
name (defined later in the code). The naming is working fine they are
just all being saved down to c:\. Is it possible it has something to
do with Adobe Pro 7.0 & it's distiller? Sorry if I'm leaving any vital
information out I'm a newbie poster here. Thanks in advance for any
help you guys might be able to provide!


--
Iwant2learn
------------------------------------------------------------------------
Iwant2learn's Profile: http://www.excelforum.com/member.php...o&userid=33461
View this thread: http://www.excelforum.com/showthread...hreadid=532644

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Defining string using InStr function help

Step through it line by line (F8 key) and check the variable values as you
go. Add a debug line above the If statement ("Debug.Print
ActiveWorkbook.Name"). Is the name value (that will be seen in the
"Immediate" window of the VBE) what you were expecting?


"Iwant2learn"
wrote in message
...

Hello, I'm trying to define a string *Foldernames* based off the name of
the active workbook. An excerp of my code is below but the macro is
using the default string. The worksheet name is Atlas_Daily_PDF. I
can't figure out why this is not recognizing the worksheet and changing
the Foldernames. Any help is greatly appreciated.

Dim Foldernames As String
Foldernames = "C:\"
If InStr(1, ActiveWorkbook.Name, "Atlas") < 0 Then
Foldernames = "L:\CMD\CMD_Risk\Customer
Valuations\Valuation Archives\Atlas\"
End If


I'm basically trying to Save each worksheet in my workbook to PDF
format where the name of the file and location is based off the sheet's
name (defined later in the code). The naming is working fine they are
just all being saved down to c:\. Is it possible it has something to
do with Adobe Pro 7.0 & it's distiller? Sorry if I'm leaving any vital
information out I'm a newbie poster here. Thanks in advance for any
help you guys might be able to provide!


--
Iwant2learn
------------------------------------------------------------------------
Iwant2learn's Profile:
http://www.excelforum.com/member.php...o&userid=33461
View this thread: http://www.excelforum.com/showthread...hreadid=532644



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Defining string using InStr function help


John, thank you very much for the speedy response. You made me realize
I'm referring to the workbook name instead of the worksheet name. I
fixed that issue only to find that Adobe's distiller doesn't like the
spaces in my folder names. To save headaches I think I'll just set the
files to save to c:\ and then just put a function in the macro to move
the files to the specified folders.

Thanks again!


--
Iwant2learn
------------------------------------------------------------------------
Iwant2learn's Profile: http://www.excelforum.com/member.php...o&userid=33461
View this thread: http://www.excelforum.com/showthread...hreadid=532644

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Defining string using InStr function help


John, thank you very much for the speedy response. You made me realize
I'm referring to the workbook name instead of the worksheet name. I
fixed that issue only to find that Adobe's distiller doesn't like the
spaces in my folder names. To save headaches I think I'll just set the
files to save to c:\ and then just put a function in the macro to move
the files to the specified folders.

Thanks again!


--
Iwant2learn
------------------------------------------------------------------------
Iwant2learn's Profile: http://www.excelforum.com/member.php...o&userid=33461
View this thread: http://www.excelforum.com/showthread...hreadid=532644

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
Use InStr function in formula? Lee Hunter Excel Worksheet Functions 8 May 8th 23 03:45 AM
Help with VBA InStr() function EagleOne Excel Discussion (Misc queries) 10 April 12th 07 02:47 PM
InStr Function Question gfh28105 Excel Programming 3 September 14th 05 02:28 AM
Find number of spaces in a string (instr) DejaVu[_46_] Excel Programming 4 September 13th 05 02:26 AM
Instr function problem Ross Withey Excel Programming 9 November 14th 03 08:02 AM


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