Use VBA to add to existing number in cell

I am using a userform to select the data I need in certain cells. 
However, if there is existing information I want to add the following
and not overwrite.

Range("C14").Select
ActiveCell.FormulaR1C1 = _
"=Sheet1!R[-2]C[6]+Sheet2!R[5]C[2]+Sheet3!R[58]C[24]"

Could anyone help,
Thanks
Hywel


-- 
Hywel
------------------------------------------------------------------------
Hywel's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=14824
View this thread: http://www.excelforum.com/showthread.php?threadid=490701

0
12/5/2005 11:45:59 AM
excel.misc 78881 articles. 5 followers. Follow

2 Replies
617 Views

Similar Articles

[PageSpeed] 57

This type of code can lead to a problem: if you take the value of the
cell and add those three other cells, what's to prevent you from
accidentally doing it again, thereby skewing your data?

0
CycleZen (674)
12/5/2005 2:43:04 PM
One way:

    With Range("C14")
      .FormulaR1C1 = "=" & IIf(IsEmpty(.Value), "", .Value & "+") & _
        "Sheet1!R[-2]C[6]+Sheet2!R[5]C[2]+Sheet3!R[58]C[24]"
    End With





In article <Hywel.1zkf9b_1133783407.9398@excelforum-nospam.com>,
 Hywel <Hywel.1zkf9b_1133783407.9398@excelforum-nospam.com> wrote:

> I am using a userform to select the data I need in certain cells. 
> However, if there is existing information I want to add the following
> and not overwrite.
> 
> Range("C14").Select
> ActiveCell.FormulaR1C1 = _
> "=Sheet1!R[-2]C[6]+Sheet2!R[5]C[2]+Sheet3!R[58]C[24]"
> 
> Could anyone help,
> Thanks
> Hywel
0
jemcgimpsey (6723)
12/5/2005 3:13:14 PM
Reply:

Similar Artilces:

use of xsd.exe
VS2005. I'm running a stored procedure and am stuffing the output into a dataset. I want the dataset to be strongly-typed, but can't seem to get quite what I want out. Performing a "Fill" on a generic dataset, I can get the schema of the data being returned. A snippet appears below: <xs:element name="Table2"> <xs:complexType> <xs:sequence> <xs:element name="PRODUCT_GROUP" msprop:OraDbType="126" type="xs:string" minOccurs="0" /> <xs:element ...

Using insert to paste a row--how done in Excel 2007
Hi, In my old version of Excel, I could copy a row or chunk of rows, move to a new spot and use the "insert row" icon to insert the rows and paste it automatically. Now in Office 2007 it just inserts a row instead of what I have copied. I want it the old way! How do I do it? -- Thanks, PTweety R-click, Insert Copied Cells. pickytweety wrote: > Hi, > In my old version of Excel, I could copy a row or chunk of rows, move to a > new spot and use the "insert row" icon to insert the rows and paste it > automatically. Now in Office 2007 it just inserts a r...

How to see calculation and heading in same cell.
I would like the cell to perform a calculation and then display the answer as will as a heading. In other words the answer and the heading will appear in the same cell. Perhaps you mean something like ="Heading Name: "&A1+B1 ******************* ~Anne Troy www.OfficeArticles.com "Jeracho" <Jeracho@discussions.microsoft.com> wrote in message news:F34BACB9-E2DA-448A-924D-46A475F98F91@microsoft.com... > I would like the cell to perform a calculation and then display the answer as > will as a heading. In other words the answer and the heading will appear in...

Saving Excel workbook in SQL server using c#
Could anyone please help me out as to how we can save the excel workbook in the database and read it back. I was able to convert the text files and image files into binary format and save them to the DB and finally able to retrive them back in the same format. But was unable to do same for the excel object. Your help will be greatly appreciated. Thanks, regards, jitender ...

Removing non-existent DC from 2000 Domain
Hello, We have a Windows 2000 domain with 2 DC. One of them crashed and we bought a new hardware and Windows 2003 Server to replace it. But I can't in no way to remove the account of the failed DC from AD and when I try to add the new server with the same name as the failed one into the domain, I got an error: "The specified user already exists" Do one knows how can I remove all data, related to the failed DC from AD, so I could add a new DC with the same name? I have already used NTDSUTIL and removed the failed server from the site, but it seems this is not enough. Thanks, G...

How can I add numbers but ignore the minus signs?
How can I add numbers but ignore the minus signs? In the following, the answer I'm after is 17 A1 -10 A2 5 A3 -2 =SUMPRODUCT(ABS(A1:A3)) Gord Dibben MS Excel MVP On Thu, 07 Jun 2007 04:19:52 GMT, Invalid <invalid@invalid.comINVALID> wrote: >How can I add numbers but ignore the minus signs? In the following, the >answer I'm after is 17 > >A1 -10 >A2 5 >A3 -2 > > Gord Dibben <gorddibbATshawDOTca> wrote in news:1o2f63pa84r8o6tdf65sa9ptpbv0nlt7u6@4ax.com: Thank you Gord. ----- > =SUMPRODUCT(ABS(A1:A3)) > > > Gord Dibben M...

check number > 10000
I have a checking account where my check numbers recently went over the 10000 mark and my credit union told me that the OFX format only goes up to 9999 so they start over at check number 1. I find it hard to believe that this could really be true. Anyone else run into this and have a better solution? Would another bank not have this issue? I use Money 2004 and it allows me to enter check numbers over 10000, but when I download my transactions from my Credit union it knows enough to match the check up correctly (IE: Credit union check number 10 match my entry of 10010) but when I accept ...

How to add summary fields to Group Footer in Access Reports?
How do you add a Summary fields to Group Footers in Access? I have a Detail field I want to Sum in the Group Footer in my report. -- Pat Dools ...

Installed Exch2007 into existing 2003 site, cant send mail
I installed an Exchange 2007 server into our domain. This server is meant to be a test server. It created a different routing group for itself. It seemed to propogate all the correct settings for the connectors and our DMZ smart hosts, yet, on the test account I created, I cannot send email to either internal users on Exchange 2003 or to the Internet. -- "Technology also allows us to get very angry and abusive with people who can't punch us in the nose at that very minute." Scott Adams ...

Looking for someone who can integrate CRM with GP using SCRIBE Integration tool
Hi, Is anyone out there in Sydney area who would like to help us in doing integration between CRM 4 and GP 10 through SCRIBE integration tool for a fee? We are looking for someone who has already done integration between these two applications using SCRIBE. You will have to do bit of customisations in the SCRIBE standard templates. If anyone available, you can contact me through my email badri1203@gmail.com Badri ...

Coping part of a cell content into a seperate cell
Hi I have two cells, one containing first and middle name and another one with surname. I want to combine the first name and surname into a separate cell, can you advise how I can just copy the first name and miss out the middle name please?? Thanks Caz Hi, I assume that the midle name is separated by a space from the first name and is in column A and the last name in column B =TRIM(LEFT(A2,FIND(" ",a2)-1))&" "&B2 "Caz H" wrote: > Hi > I have two cells, one containing first and middle name and another one with &g...

VBA code to hide all the tables on form open
I don't want people to use a blank mdb to import my tables. I manually hide them all. However, after running the macro to delete all records and import from .txt, the table become unhide. I do the importation on daily basis. I posted to macro newsgroup and asked way to hide table after importation action macro but got no answer. Maybe it cannot be done in macro? If so, I need VBA code to hide all the tables on form open. Thanks. Hiding your tables won't prevent people from being able to import them into a blank mdb. All they have to do is ensure that they've set the datab...

Using A CTabView
Hi, I need to implement a tab control which contains a number of custom controls on each tab page. For example my custom control has a number of LED type static controls and a list control. Its quite small, 200x200. I need a number of them in a tab page. They need to aligned underneath each other with a static label above each giving a description of each one. I also need to be able to scroll down if I have too many to fit into one page. Has anyone done something similar or can suggest where to look?? Cheers ...

Money 2007 add/delete Category
Is there a way to maintain my categories by viewing a list so easily add/delete categories? The Category maintenance in 2007 sucks.. I need to run through every single category just to delete one. Deluxe or Essential? If Deluxe, use the Account List More pull out, Categories & :Payees|Categories should show you all the categories at once and allow you to Move, Modify or Delete them as required. The pulldown at the top lets you see just Categories or Categories and Subcategories. "Vital" <Vital@discussions.microsoft.com> wrote in message news:4D4AAA91-6602-429E-915...

Adding a formula to the same cell (H5) on every tab
I have an inventory spreadsheet with 125 tabs. The tabs are numbered 1 through 125. The are identical except for the data below the column headings. If I wanted to put a formula in H5 on every tab, can it be done other than manually opening every tab and typing it? One additional question: If I add a Summary Tab, how could I show the value of a specific cell on each tab without manually entering it? I show the formula I'm using bring B3 to the summary for every tab: A B 1 Unit Value 2 1 ='1'!B3 3 2 ='2'!B3 4 3 ='3'!B3 5 4 ='4'!B3 6 5 ='5'!B3 7...

HOW USE 2 LANGUAGES IN AX. ???????????
Hello I have problem and I need Help: 1. Axapta using English Language in all system 2. I need write something in Russian Language. When I use Russian Keyboard and I wriet somethings in Axapta fields is ok, but after this Russian words was change and I see only symbol likely this ??????? (query) 3. In MS SQL database in the fields I see words likely this symbol ??????? (query) Please send my all information how I can write something in different Languages in this same Axapta - I need write simultaneously in 2 Languages. Please send answer on ma email: search1234@wp.pl Thank...

sumproduct--counting--zero--blank cells
I'm using these formula to count, =SUMPRODUCT(($W$9:$W$272>=0)*($W$9:$W$272<10)) =SUMPRODUCT(($W$9:$W$272>=10)*($W$9:$W$272<20)) ........etc how do i get it so bank cells are excluded from the count. The way it is now, they are counted in the 0 to 10 range... Thanks Jeremy -- Message posted via http://www.officekb.com COUNTBLANK(range) "jeremy via OfficeKB.com" wrote: > I'm using these formula to count, > > =SUMPRODUCT(($W$9:$W$272>=0)*($W$9:$W$272<10)) > =SUMPRODUCT(($W$9:$W$272>=10)*($W$9:$W$272<20)) > ........etc > how do...

Using a Space in Webbrowser Control
Hello: As usual, I've run into a problem with something that is probably so simple... any help is appreciated. I'm using the webbrowser control with the navigate method. The url I'm using needs a space (which I know is not normally allowed, but it works directly in firefox and IE). Here's some sample code: ------------------------------------ strWebPage = "http://www.imdb.com" &" ?" & Text2.Text txtURL.Text = strWebPage Web1.Navigate txtURL.Text Do While Web1.ReadyState <> READYSTATE_COMPLETE DoEvents Loop DoEven...

Add Company Holidays To Calendars
Hello, I'm trying to find a simple way to automatically add all company holidays to everyone's calendar in my organization. We would prefer to stay away from sending meeting invites to everyone as this becomes overhead when people join the company and when they leave. I have investigated using the Outlook.HOL file and asking everyone to import the custom holidays that we add to that file, but that involves a lot of overhead as well. Is there a way to set this up within Exchange to automatically populate certain events on peoples calendars? Thank you. -- Jason Gay, MCSE, CCNA Tec...

find sum in list of of numbers
Hello, I have a list of numbers in a column and I need to find which numbers when summed together equal a figure. I have a list of invoice amounts that I need to match up with payments (the payments are always made for several invoices so I need to come up with sums of several invoices to get to this payment amount). An example would be I have this in the following section (A1:A10): $17,213.82 $4,563.02 $85,693.42 $1,166.01 $725.90 $580.09 $2,243.75 $240.16 $207.70 $725.90 I need to find which combination of these figures would sum $1,173.76. Thanks in Advance, Dza the troubled ...

References omit formatting and return cell address
In two cases of references between worksheets, the formatting from the original cell does not appear in the cell that it is referenced to. Case 1: Worksheet 1, A1 contains a currency formatted number - $2,000 Worksheet 2, A1 references the Workhseet 1, A1 cell using the = sign, yet it returns 2000 (unless I manually reformat the Workksheet 2 cell to Currency Case 2: Worksheet 3, A1 contains an apartment # - e.g. 4 Worksheet 4, A1 references this cell but returns the cell address - Worksheet2,!A1' - rather than the number 4. I tried different formats for the number 4,...

Cannot add new account to Money 2006
Hi all, I've bought Money 2006 std at last week, and first I've tried to import my Money 2000 file. The Money 2006 said that the file is not importable. OK. I've tried to create new file, which was successfully created, but I cannot add any new account. I've always got the same error message: The operation cannot be performed. Details: Product: Money ID: obres:34 Source: 15.0 Version: 15.0 Symbolic name: errUnknown Message: This operation cannot be performed. Reason Usually caused by a corrupt file. User Operation Run the Money File Repair tool to fix th...

How can I insert a cell reference in a footer (eg for variable foo
Any ideas on how to do this? I'm trying to create a template with the doc reference number in the footer However, I'm trying to avoid users having to edit the footer (because this just wont get done). Hi only possible with VBA using an event procedure. e.g. put the following code in your workbook module for cell A1 Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim wkSht As Worksheet For Each wkSht In Me.Worksheets With wkSht.PageSetup .CenterFooter = wksht.range("A1").value End With Next wkSht End Sub -- Regards Frank Kabel Frankfurt, Ger...

How to recall the Phone number ... what about other variables?
Hi just a simple question, I'm customizing my status.htm page. Without having any guide, I'm guessing almost every variable. One of the easy of them: Customer's PhoneNumber.... I tried with QSRules.Transaction.Customer.PhoneNumber but didn't bring my anything What is the right syntax? Does anybody have any list of variables you can call using QSRules ? Thanks Gustavo Gustavo, try this out: QSRules.Transaction.Customer.HomeAddress.PhoneNumber ...

Cash-Basis Reporting using GP Analytical Accounting
We are a new GP 8 customer, still in the process of implementation, migrating from QuickBooks Pro. We are a non-profit and have unique reporting needs for our board and donors. We switched from cash-basis to accrual accounting about 2 years ago. However, a lot of our reports are still run on a cash-basis level, we need to be able to report on a cash basis as well as accrual basis. I know ther eis a cash-basis tool add-on for GP from AIM technologies. But I was wondering if the GP Analytical Accouning or multidimensional module would give us the same functionality and flexibility in g...