ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem updating nested IF statement results (https://www.excelbanter.com/excel-programming/393912-problem-updating-nested-if-statement-results.html)

Zakynthos

Problem updating nested IF statement results
 


I'm using the following formula to give a value to several items of data
that I want to link into a Visualbasic program:

=IF((AND($U$1=Y2,Z2="D")),1,0), where $U$1 is the copy of a date in U2 (set
up as a relative link to another spreadsheet.

However, when I run a macro to copy the date in U2
(as either values or values and number formats) into U1 the formula does not
update in the row where the condition is met.

Why does it not update and how can I solve this problem?

Many thanks


Bob Phillips

Problem updating nested IF statement results
 
I just knocked up some simple simulation code, and it worked for me.

Where is the formula (which cell)? Show the copy code.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Zakynthos" wrote in message
...


I'm using the following formula to give a value to several items of data
that I want to link into a Visualbasic program:

=IF((AND($U$1=Y2,Z2="D")),1,0), where $U$1 is the copy of a date in U2
(set
up as a relative link to another spreadsheet.

However, when I run a macro to copy the date in U2
(as either values or values and number formats) into U1 the formula does
not
update in the row where the condition is met.

Why does it not update and how can I solve this problem?

Many thanks




Zakynthos

Problem updating nested IF statement results
 
Bob,

Many thanks - the copy code is:

Selection.Copy
Range("U1").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False

The formula is in cell: AG20. AC20 has the value 08/09/2007 and AE20 has
the value "E"

Best wishes,

Tony



"Zakynthos" wrote:



I'm using the following formula to give a value to several items of data
that I want to link into a Visualbasic program:

=IF((AND($U$1=Y2,Z2="D")),1,0), where $U$1 is the copy of a date in U2 (set
up as a relative link to another spreadsheet.

However, when I run a macro to copy the date in U2
(as either values or values and number formats) into U1 the formula does not
update in the row where the condition is met.

Why does it not update and how can I solve this problem?

Many thanks



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com