Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Hywel
 
Posts: n/a
Default 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...o&userid=14824
View this thread: http://www.excelforum.com/showthread...hreadid=490701

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave O
 
Posts: n/a
Default Use VBA to add to existing number in cell

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?

  #3   Report Post  
Posted to microsoft.public.excel.misc
JE McGimpsey
 
Posts: n/a
Default Use VBA to add to existing number in cell

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 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Number of worksheet tabs as cell value? ie 4 work sheets = 4 cell value [email protected] Excel Discussion (Misc queries) 2 November 22nd 05 05:17 PM
copying cell names Al Excel Discussion (Misc queries) 12 August 11th 05 03:01 PM
Maximum Number of Cell Formats Jim Allen Excel Discussion (Misc queries) 4 April 19th 05 07:07 PM
changing a cell from date to a number mwhite Excel Worksheet Functions 1 March 22nd 05 04:35 PM
number of character occurences in a cell Ron Excel Discussion (Misc queries) 1 March 21st 05 04:55 PM


All times are GMT +1. The time now is 06:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"