Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 354
Default Macros and Formulas

I would like to create a macro which will insert a function which
incorporates different cells. For example, =($A$3 * B3) where the B3 will
become B4 in the next cell below. Is this possible?

Thanks,

Daniel
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Macros and Formulas

Daniel,
Try this


Sub mariner()
Range("B3").Formula = "=$A$3*B3"
Range("B3").AutoFill Destination:=Range("B3:B50")
End Sub

Mike
"Daniel" wrote:

I would like to create a macro which will insert a function which
incorporates different cells. For example, =($A$3 * B3) where the B3 will
become B4 in the next cell below. Is this possible?

Thanks,

Daniel

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 354
Default Macros and Formulas

Thanks!

I will try it out.

"Mike H" wrote:

Daniel,
Try this


Sub mariner()
Range("B3").Formula = "=$A$3*B3"
Range("B3").AutoFill Destination:=Range("B3:B50")
End Sub

Mike
"Daniel" wrote:

I would like to create a macro which will insert a function which
incorporates different cells. For example, =($A$3 * B3) where the B3 will
become B4 in the next cell below. Is this possible?

Thanks,

Daniel

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,533
Default Macros and Formulas

Hi Daniel

Maybe this will help you:

Sub InsertFunction()
For r = 3 To 10
Cells(r, "C").Formula = "=($A$3 * B" & r & ")"
Next
End Sub

Regards,
Per

"Daniel" skrev i meddelelsen
...
I would like to create a macro which will insert a function which
incorporates different cells. For example, =($A$3 * B3) where the B3
will
become B4 in the next cell below. Is this possible?

Thanks,

Daniel


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Macros and Formulas

Sub autofilformulas()
For i = 1 To 3
Cells(i, "H").Formula = "=$b$3*h" & i
Next i
End Sub
or

Sub autofilformulas()
For i = 1 To 3
'Cells(i, "H").Formula = "=$b$3*h" & i
Cells(i, "H").Value = Range("b3") * Range(h" & i)
Next i
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Daniel" wrote in message
...
I would like to create a macro which will insert a function which
incorporates different cells. For example, =($A$3 * B3) where the B3
will
become B4 in the next cell below. Is this possible?

Thanks,

Daniel




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
Can I insert formulas into my macros? Sarah Excel Discussion (Misc queries) 3 April 3rd 08 01:07 PM
using formulas in macros BBEXCELNOVICE Excel Discussion (Misc queries) 4 November 12th 06 10:03 AM
formulas vs macros excelFan Excel Discussion (Misc queries) 4 March 23rd 06 01:45 PM
Macros/Formulas Michelle Excel Worksheet Functions 2 October 26th 05 04:26 PM
Help with populating cells using formulas or macros dmsalvay1978 Excel Discussion (Misc queries) 2 August 31st 05 01:01 AM


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