Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Fixing a procedure result.

Posted on 2013-11-13
6
Medium Priority
?
267 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
  • 3
  • 2
6 Comments
 
LVL 37

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 Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

877 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