LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 123
Default Using a macro to enter a formula

i'm trying to writ a macro that enters in a formula in a cell.

Scenario:
Assume my cursor is in row 8
I want to put a formula of "=O$9" in cell M9

Here's what i've got so far (but its not working)

dim x as integer
lr=activecell.row 'tells me what row i'm on
x=lr+1 'adds 1 to row number
cells(x,13).select 'move my cursor to column M of row x
ActiveCell.FormulaR1C1 = "=+RxC[2]" 'put the O$x formula in

thanks in advance for any assistance.
tami




 
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
Macro to select cells in column enter data then press enter NP New Users to Excel 1 February 20th 08 04:21 PM
Enter Static Date with a formula or macro Jason Southco Excel Discussion (Misc queries) 3 March 14th 06 07:46 PM
What does hitting Ctrl + Shift + Enter to enter a formula do??? Help a n00b out. qwopzxnm Excel Worksheet Functions 2 October 20th 05 09:06 PM
Make macro run when I hit the enter key Tommy Excel Discussion (Misc queries) 1 May 16th 05 12:53 AM
Can you enter a formula in a cell to run a macro? Nevaeh Excel Worksheet Functions 2 February 14th 05 11:51 PM


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