Solved

Fixing a procedure result.

Posted on 2013-11-13
6
255 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 35

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 500 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

710 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