LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default modify existing macro

Howdie all.

I have a macro that I've made based on a recorded macro.
It sets the headers, and footers of a worksheet.
I've been able to set it up so that it inputs the digits of the workbook's
name (I specifically did not want to use &[file]).

At this point, I was thinking that I'd like to use the file name as a basis
to set one more element.

I.e.,

MyClmVar=fname 'already set up
SSide = "P.11489, C. 4827" 'newcomer

here's what I have so far.

-----------------------------
Sub FooterArray()
Dim SSide As String
Dim myFooter(231 To 266) As String
Dim fname As String
Dim fname1 As String
Dim MyClmVar As String

SSide = " P.11489, C.4827"

fname = ActiveWorkbook.Name 'this looks at the existing file's name

'remove extension
fname = Left(fname, InStr(fname, ".") - 1)


MyClmVar = fname

fname1 = Right(fname, InStr(fname, "-") - 1) 'removes everything except last 3
'digits of file name

'this next next part is what I am having trouble with.
'Based on the watch's that I've set, myFooter never contains any values.
'thus my question here becomes-- how can I set a specific list of values--
from 231
'through 266 inclusive to be the values for myFooter?
'I.e., myfooter(231) has the value 231, etc.... through to myfooter(266) has
the
'value 266.
'As I'm specifically interested in comparing the fname1 to the value of
myfooter(i)
'for my if test.


If fname1 Like ["myFooter()"] Then


With ActiveSheet.PageSetUp
.CenterFooter = "&""Arial,Bold""&14 " & MyClmVar & SSide
End With

'the balance of this works great.
Else

With ActiveSheet.PageSetUp
.CenterFooter = "&""Arial,Bold""&14 " & MyClmVar
End With
End If


End Sub

Your helps are appreciated.



 
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
Help!! To modify existing formula housinglad Excel Discussion (Misc queries) 2 February 11th 10 09:18 PM
Modify the existing formula wilchong via OfficeKB.com New Users to Excel 3 December 16th 08 11:02 AM
modify existing macro SteveDB1 Excel Programming 2 November 18th 08 12:16 AM
Need to Modify Existing Code Ryan Hess Excel Programming 3 August 3rd 07 07:42 PM
Modify an existing Cell formula using VBA Matt[_2_] Excel Discussion (Misc queries) 2 June 11th 07 08:50 PM


All times are GMT +1. The time now is 04:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"