Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default Multisheet IF Function

I am trying to accomplish the following: If the value on Sheet 1 Cell K3 is
blank, then the value on Sheet 2 Cell K3 is automatically left blank.
Otherwise, any value entered on Sheet 1 Cell K3 will automatically be copied
to Sheet 2 Cell K3. It is possible that the value entered in Sheet 1 Cell K3
is preceeded by one or more zeros, so I have formatted Sheet 2 Cell K3 as
'text'. I have tried the formula =IF(Sheet1!K3=0,"",(Sheet1!K3)) in Sheet2
Cell K3, which doesn't work. Thanks for your help!

Regards,
Larry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Multisheet IF Function

Formulas return Values, not formats. To copy the format, you'll need
VBA. One way:

put this in your Sheet 1 code module (right-click the Sheet 1 tab and
choose View Code):


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address(False, False) = "K3" Then
With Sheets("Sheet2").Range("K3")
.NumberFormat = "@"
.Value = Target.Text
End With
End If
End Sub




In article ,
"Larry" wrote:

I am trying to accomplish the following: If the value on Sheet 1 Cell K3 is
blank, then the value on Sheet 2 Cell K3 is automatically left blank.
Otherwise, any value entered on Sheet 1 Cell K3 will automatically be copied
to Sheet 2 Cell K3. It is possible that the value entered in Sheet 1 Cell K3
is preceeded by one or more zeros, so I have formatted Sheet 2 Cell K3 as
'text'. I have tried the formula =IF(Sheet1!K3=0,"",(Sheet1!K3)) in Sheet2
Cell K3, which doesn't work. Thanks for your help!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default Multisheet IF Function

Thanks. That formula didn't accomplish what I hoped. I'm not concerned
about the formatting, just the IF formula to copy anything placed in Sheet 1
Cell K3 to Sheet 2 Cell K3. If Sheet 1 Cell K3 is blank, the Sheet 2 Cell K3
should be blank. Otherwise, any valu placed in Sheet 1 Cell K3 should be
copied to Sheet 2 Cell K3. I can work around the zero value defaults.

"JE McGimpsey" wrote:

Formulas return Values, not formats. To copy the format, you'll need
VBA. One way:

put this in your Sheet 1 code module (right-click the Sheet 1 tab and
choose View Code):


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address(False, False) = "K3" Then
With Sheets("Sheet2").Range("K3")
.NumberFormat = "@"
.Value = Target.Text
End With
End If
End Sub




In article ,
"Larry" wrote:

I am trying to accomplish the following: If the value on Sheet 1 Cell K3 is
blank, then the value on Sheet 2 Cell K3 is automatically left blank.
Otherwise, any value entered on Sheet 1 Cell K3 will automatically be copied
to Sheet 2 Cell K3. It is possible that the value entered in Sheet 1 Cell K3
is preceeded by one or more zeros, so I have formatted Sheet 2 Cell K3 as
'text'. I have tried the formula =IF(Sheet1!K3=0,"",(Sheet1!K3)) in Sheet2
Cell K3, which doesn't work. Thanks for your help!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Multisheet IF Function

If you're not concerned with formatting, just put this in Sheet2!K3:

=IF(Sheet1!K3="","",Sheet1!K3)

In article ,
"Larry" wrote:

Thanks. That formula didn't accomplish what I hoped. I'm not concerned
about the formatting, just the IF formula to copy anything placed in Sheet 1
Cell K3 to Sheet 2 Cell K3. If Sheet 1 Cell K3 is blank, the Sheet 2 Cell K3
should be blank. Otherwise, any valu placed in Sheet 1 Cell K3 should be
copied to Sheet 2 Cell K3. I can work around the zero value defaults.

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
Multisheet range in SUMPRODUCT? Joe User[_2_] Excel Discussion (Misc queries) 5 April 6th 10 06:42 PM
How do I delete the same row in a multisheet spreadsheet John M.Lees Excel Discussion (Misc queries) 2 October 15th 08 05:29 PM
Select and Insert one sheet from a multisheet excel template Alex at Europlan Excel Discussion (Misc queries) 0 November 22nd 05 03:51 PM
Multisheet formula Todd Nelson Excel Discussion (Misc queries) 8 August 31st 05 07:29 PM
MultiSheet macro, to sum based on condition msMope Excel Programming 1 June 30th 04 08:40 AM


All times are GMT +1. The time now is 01:10 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"