A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Visual Basic....Calculate Button



 
 
Thread Tools Display Modes
  #2  
Old April 1st, 2004, 10:41 PM
Don Guillett
external usenet poster
 
Posts: n/a
Default Visual Basic....Calculate Button

Something like this should help and you will need NO buttons of any kind.
Right click on the sheet tabview codecopy/paste this.Modify to suit.
As written, any number entry in column D which is column 4 will add 3 to the
number in col f.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column 4 Then Exit Sub
On Error GoTo doagain
Cells(Target.Row, "f") = Target + 3
doagain:
MsgBox "error-Enter a number"
Exit Sub
End Sub

--
Don Guillett
SalesAid Software

"sowetoddid " wrote in message
...
Another question...

How would I designate which cells to calculate, using this command? I
am not too familiar with manipulating this formula.

x=activecell.row
cells(x,"n")=whatever




This is my attempt...

Sub EnterFormula()

Worksheets("GasEvents").Range("N41").Formula="=Rel easeWorksheet!H26"
End Sub

(repeated for each cell in the row 41)

If I am doing that corrects, it would still cause the formula to stay
in the cells...which would cause the values of 41 to change each time
new data is entered for row 42, 43, etc. I want row 41 to maintain it
values even after new data is inputted for row 42, 43, etc.


---
Message posted from
http://www.ExcelForum.com/



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:13 PM.


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