View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
lbauckman lbauckman is offline
external usenet poster
 
Posts: 1
Default Help needed coding a macro to adjust the source of information each time it is run


I am a serious newby with macros, but would like to modify what I am
doing to avoid having to edit a series of macros I use, everytime I use
them. Essentially, I have a bunch of different workbooks that are more
or less templated copies of each other but vary according to certain
details that don't affect the macro. I have recorded a simple macro
that starts in a cell on the active sheet and then needs to refer to
the next sheet in the book to run a simply formula and pull the
information back to the active sheet. My problem is that everytime I
update the workbook I need to copy the active sheet and apply a new
name to the newly copied sheet. Names of sheets are simply the date
corresponding to the information on that sheet (ie. 03 10 30). My macro
keeps referring back to the sheet I used when I originally recorded it
(obviously!). I would like to edit the code so that the macro knows to
simly go the sheet immediately behind the active sheet. This is a
sample of my code:

Sub start_ct()
'
' start_ct Macro
' Macro recorded 10/13/2003 by Family
'

'
Range("G38:M46").Select
Selection.ClearContents
Range("F38").Select
ActiveCell.FormulaR1C1 = _
"='03 09 17'!RC-'03 09 17'!RC[2]-'03 09 17'!RC[3]+'03 09
17'!RC[4]+'03 09 17'!RC[7]"
Selection.Copy
Range("F39:F46").Select
ActiveSheet.Paste
End Sub


ANy ideas?

Thanks, Lori!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/