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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

if.... Anyway around this?



 
 
Thread Tools Display Modes
  #1  
Old April 12th, 2006, 04:21 AM posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: n/a
Default if.... Anyway around this?

I'm new to this. I need to drop a value into a cell where there is nothing.
The 'target' cell should not have a formula because some days I would need
to place a one time value there , doing so would wipe out the formula.

Example:

A1 B1 C1
BOB JOE =IF(A1="bob",A2=B1)

A2
(BLANK)


I need the blank cell (A2) to take the value of B1 if C1 is true.
Maybe I have the syntax wrong, maybe it's not possible. Let me know.

Thanks



  #2  
Old April 12th, 2006, 05:10 AM posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: n/a
Default if.... Anyway around this?

In C1, enter
=A1="bob"

In A2, enter
=IF(C1, B1, "")

or leave C1 empty and enter in A2
=IF(A1="bob", B1, "")

You cannot write a function in cell C1 that will place a value in A2.
Functions return values, they don't manipulate other objects (at least not
when called from a worksheet).


" wrote:

I'm new to this. I need to drop a value into a cell where there is nothing.
The 'target' cell should not have a formula because some days I would need
to place a one time value there , doing so would wipe out the formula.

Example:

A1 B1 C1
BOB JOE =IF(A1="bob",A2=B1)

A2
(BLANK)


I need the blank cell (A2) to take the value of B1 if C1 is true.
Maybe I have the syntax wrong, maybe it's not possible. Let me know.

Thanks




  #3  
Old April 12th, 2006, 11:46 AM posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: n/a
Default if.... Anyway around this?

Hi

This may get you started:

Right-click on the sheet tab and select View Code.

Paste this code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target Range("A1") Then Exit Sub
If Range("A1").Value = "bob" Then
Range("A2").Value = Range("B1").Value
End If
End Sub

The code only runs if cell A1 has been changed and only checks to see
if "bob" has been entered in that cell, if it has then if copies the
data in B1 to A2.

Regards

Steve

 




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 11:01 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.