Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Fixing a procedure result.

Posted on 2013-11-13
6
Medium Priority
?
264 Views
Last Modified: 2013-11-13
How come in the following the result is zero, instead of =Base?  I am loading a value in the cell that is named "Base" after this runs.

Range("AT7").Select
    ActiveCell.FormulaR1C1 = "=Base"
    Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column - 1).End(xlUp).Offset(, 1)).Value = ActiveCell.Value

Is there a way to, when a value is added to AT7, a script like this run, and put them in as values instead of a formula?

Interested to both solutions.  Please advise and thanks. -R-
0
Comment
Question by:RWayneH
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 36

Expert Comment

by:Kimputer
ID: 39644809
Second part of your question. Not sure about the first, for me it's zero, only if you didn't have a Named range. If you have a named range (single cell, otherwise you will get error again), it will have the correct display value (and correct formula)
   ActiveCell.FormulaR1C1 = Range("Base").Value

Open in new window

0
 

Author Comment

by:RWayneH
ID: 39644824
It is a single cell...  and the value is zero when the formula is added, however when I added the actual value.. because there is a value in the column instead of a formula it does not chg all the column to whatever I put in AT7.  I want of whatever is placed in AT7 to copy to the cells that have the =Base in it.   AT7 is named Base.  Does this help? -R-
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 2000 total points
ID: 39644828
You are replacing your formula with a value before you assign a value to Base so the value you replace the formula with will be 0. Perhaps you just want:

Range("AT7", Cells(Rows.Count, "AS").End(xlUp).Offset(, 1)).Formula = "=Base"

Open in new window

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:RWayneH
ID: 39644833
I am expecting the formula to be copied down, not a value, perhaps I need to add the formula inside the copy down part? -R-
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 39644853
The code I posted will put the formula in all the cells.
0
 

Author Closing Comment

by:RWayneH
ID: 39644922
EXCELent... worked great.  Thanks. -R-
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question