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: 41
Default macro writing formula

I've got a possible tricky one here, i have a summary sheet with data sheets
behind it, users can press a button on the last data sheet which creates a
new sheet containing the same formulas, into which new data can be inputted.

on my summary sheet i have a section showing the totals column from each
sheet, so i have tried to include in the macro that after the new sheet is
made, a new column is put in and the formulas are entered.

I have worked out the code to use the next column along and to input the
formula into the top cell before dragging it down, but the problem lies in
naming the sheet the data comes from. my code is as follows:

Sub Macro13()

sheetname = ActiveSheet.name

Dim x, y


y = 10

Do Until x = 1

If Sheets("download").Cells(7, y) = "" Then

Sheets("download").Cells(7, y).FormulaR1C1 = "='sheetname'!R6C5"

x = 1

End If

y = y + 1

Loop

'


End Sub


where the formula is defined (where it now says 'sheetname') i want to be
able to put the active sheet name in or even text from a cell which contains
the sheet name.

any help would be much appreciated

regards

Patrick
 
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
Writing Array formula through macro Shilps[_2_] Excel Programming 11 June 21st 07 09:32 AM
Excel: VB Macro programming problem with formula writing d-cubed[_2_] Excel Programming 2 February 1st 07 07:25 PM
Writing a simple macro or formula Robin Excel Programming 2 January 28th 06 11:10 PM
VB Macro writing a formula to a cell Neal Zimm Excel Programming 2 September 15th 05 08:09 PM
Macro Writing DFIChris Excel Programming 4 April 20th 05 04:51 PM


All times are GMT +1. The time now is 10:30 AM.

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"