Solved

Fixing a procedure result.

Posted on 2013-11-13
6
213 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 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

705 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now