#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default Condition

following code works fine. Want if column (B) has (X) then target -10 else no
(X) target
not sure how to phrase this
Thanks

Public Sub CopyDonors(ByVal Target As Range)
Dim wksSummary As Worksheet
Dim rngPaste As Range
Set wksSummary = Sheets("Donors")
Set rngPaste = wksSummary.Cells(65536, "A").End(xlUp).Offset(0, 0)
Application.EnableEvents = False
Set rngPaste = rngPaste.Offset(1, 0)
Range(Target.Offset(0, -7), Target.Offset(0, 0)).Copy _
Destination:=rngPaste
rngPaste.Offset(0, 7) = Target - 10
Application.EnableEvents = True
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Condition

Curt, do you want the Target value to be 10 less or do you want to move the
Target up/left 10? I would assume you are dealing with a value since the last
cell designation is in column "H". But, not sure.
"Curt" wrote:

following code works fine. Want if column (B) has (X) then target -10 else no
(X) target
not sure how to phrase this
Thanks

Public Sub CopyDonors(ByVal Target As Range)
Dim wksSummary As Worksheet
Dim rngPaste As Range
Set wksSummary = Sheets("Donors")
Set rngPaste = wksSummary.Cells(65536, "A").End(xlUp).Offset(0, 0)
Application.EnableEvents = False
Set rngPaste = rngPaste.Offset(1, 0)
Range(Target.Offset(0, -7), Target.Offset(0, 0)).Copy _
Destination:=rngPaste
rngPaste.Offset(0, 7) = Target - 10
Application.EnableEvents = True
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default Condition

I want if no x in column (B) = target if (X) in column (B) target -10
if column b = x then target -10
if column b = "blank" then target
column h is trigger for action target cell
hope this makes it clearer. Its easy when you know what you mean. Not so
easy for othewr person. Target is a value. The x means an entry into parade
no x is a donor. Because of other things need to try to do all entry on this
sheet.
hopefully
Thanks
Curt

"JLGWhiz" wrote:

Curt, do you want the Target value to be 10 less or do you want to move the
Target up/left 10? I would assume you are dealing with a value since the last
cell designation is in column "H". But, not sure.
"Curt" wrote:

following code works fine. Want if column (B) has (X) then target -10 else no
(X) target
not sure how to phrase this
Thanks

Public Sub CopyDonors(ByVal Target As Range)
Dim wksSummary As Worksheet
Dim rngPaste As Range
Set wksSummary = Sheets("Donors")
Set rngPaste = wksSummary.Cells(65536, "A").End(xlUp).Offset(0, 0)
Application.EnableEvents = False
Set rngPaste = rngPaste.Offset(1, 0)
Range(Target.Offset(0, -7), Target.Offset(0, 0)).Copy _
Destination:=rngPaste
rngPaste.Offset(0, 7) = Target - 10
Application.EnableEvents = True
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Condition

Is this what you want?

Public Sub CopyDonors(ByVal Target As Range)
Dim wksSummary As Worksheet
Dim rngPaste As Range
Set wksSummary = Sheets("Donors")
Set rngPaste = wksSummary.Cells(wksSummary.Rows.Count, "A").End(xlUp)
Application.EnableEvents = False
Set rngPaste = rngPaste.Offset(1, 0)
If rngPaste.Offset(0,1).Value = "X" Then
Range(Target.Offset(0, -10), Target.Offset(0, 0)).Copy _
Destination:=rngPaste
rngPaste.Offset(0, 7) = Target - 10
Else
Range(Target.Offset(0, -10), Target.Offset(0, 0)).Copy _
Destination:=rngPaste
rngPaste.Offset(0, 7) = ""
End If
Application.EnableEvents = True
End Sub

--
HTH

Bob

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

"Curt" wrote in message
...
I want if no x in column (B) = target if (X) in column (B) target -10
if column b = x then target -10
if column b = "blank" then target
column h is trigger for action target cell
hope this makes it clearer. Its easy when you know what you mean. Not so
easy for othewr person. Target is a value. The x means an entry into
parade
no x is a donor. Because of other things need to try to do all entry on
this
sheet.
hopefully
Thanks
Curt

"JLGWhiz" wrote:

Curt, do you want the Target value to be 10 less or do you want to move
the
Target up/left 10? I would assume you are dealing with a value since the
last
cell designation is in column "H". But, not sure.
"Curt" wrote:

following code works fine. Want if column (B) has (X) then target -10
else no
(X) target
not sure how to phrase this
Thanks

Public Sub CopyDonors(ByVal Target As Range)
Dim wksSummary As Worksheet
Dim rngPaste As Range
Set wksSummary = Sheets("Donors")
Set rngPaste = wksSummary.Cells(65536, "A").End(xlUp).Offset(0, 0)
Application.EnableEvents = False
Set rngPaste = rngPaste.Offset(1, 0)
Range(Target.Offset(0, -7), Target.Offset(0, 0)).Copy _
Destination:=rngPaste
rngPaste.Offset(0, 7) = Target - 10
Application.EnableEvents = True
End Sub



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default Condition

Looks good will insert and see what happens
Thanks Bob
Curt

"Bob Phillips" wrote:

Is this what you want?

Public Sub CopyDonors(ByVal Target As Range)
Dim wksSummary As Worksheet
Dim rngPaste As Range
Set wksSummary = Sheets("Donors")
Set rngPaste = wksSummary.Cells(wksSummary.Rows.Count, "A").End(xlUp)
Application.EnableEvents = False
Set rngPaste = rngPaste.Offset(1, 0)
If rngPaste.Offset(0,1).Value = "X" Then
Range(Target.Offset(0, -10), Target.Offset(0, 0)).Copy _
Destination:=rngPaste
rngPaste.Offset(0, 7) = Target - 10
Else
Range(Target.Offset(0, -10), Target.Offset(0, 0)).Copy _
Destination:=rngPaste
rngPaste.Offset(0, 7) = ""
End If
Application.EnableEvents = True
End Sub

--
HTH

Bob

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

"Curt" wrote in message
...
I want if no x in column (B) = target if (X) in column (B) target -10
if column b = x then target -10
if column b = "blank" then target
column h is trigger for action target cell
hope this makes it clearer. Its easy when you know what you mean. Not so
easy for othewr person. Target is a value. The x means an entry into
parade
no x is a donor. Because of other things need to try to do all entry on
this
sheet.
hopefully
Thanks
Curt

"JLGWhiz" wrote:

Curt, do you want the Target value to be 10 less or do you want to move
the
Target up/left 10? I would assume you are dealing with a value since the
last
cell designation is in column "H". But, not sure.
"Curt" wrote:

following code works fine. Want if column (B) has (X) then target -10
else no
(X) target
not sure how to phrase this
Thanks

Public Sub CopyDonors(ByVal Target As Range)
Dim wksSummary As Worksheet
Dim rngPaste As Range
Set wksSummary = Sheets("Donors")
Set rngPaste = wksSummary.Cells(65536, "A").End(xlUp).Offset(0, 0)
Application.EnableEvents = False
Set rngPaste = rngPaste.Offset(1, 0)
Range(Target.Offset(0, -7), Target.Offset(0, 0)).Copy _
Destination:=rngPaste
rngPaste.Offset(0, 7) = Target - 10
Application.EnableEvents = True
End Sub




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
If Condition Kumar Excel Discussion (Misc queries) 0 December 5th 08 03:05 PM
lookup with multiple condition, but one condition to satisfy is en Eddy Stan Excel Worksheet Functions 2 October 27th 07 02:06 PM
Combine an OR condition with an AND condition Will Excel Discussion (Misc queries) 1 April 6th 07 03:52 PM
Condition 1 overules condition 2? Bultgren Excel Worksheet Functions 2 January 20th 06 12:29 PM
I need 4 condition for condition formatting SeeKY Excel Programming 2 June 7th 05 09:41 AM


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