#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Copy value

If B4 contains the same number as A3, how can I put the number in A4?

Here is my spreadsheet:

A B
1 0082766
2 0082767
3 0082768 0082768
4 0082768
5 0082768
6 0082768
7 0082768
8 0104361
9 0104365
10 0104367
11 0104368
12 0104370
13 0104409 0104409
14 0104409


=========


This is the result I'm looking for:


A B
1 0082766
2 0082767
3 0082768 0082768
4 0082768 0082768
5 0082768 0082768
6 0082768 0082768
7 0082768 0082768
8 0104361
9 0104365
10 0104367
11 0104368
12 0104370
13 0104409 0104409
14 0104409 0104409
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Copy value

=IF(A3=B4,A3,"")

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Copy value

On Nov 7, 1:08*pm, gary wrote:
If B4 contains the same number as A3, how can I put the number in A4?

Here is my spreadsheet:

* * * * * * *A * * * * * * * *B
* 1 * * * * * * * * * * 0082766
* 2 * * * * * * * * * * 0082767
* 3 * *0082768 * 0082768
* 4 * * * * * * * * * * 0082768
* 5 * * * * * * * * * * 0082768
* 6 * * * * * * * * * * 0082768
* 7 * * * * * * * * * * 0082768
* 8 * * * * * * * * * * 0104361
* 9 * * * * * * * * * * 0104365
10 * * * * * * * * * * 0104367
11 * * * * * * * * * * 0104368
12 * * * * * * * * * * 0104370
13 * 0104409 * *0104409
14 * * * * * * * * * * 0104409

=========

This is the result I'm looking for:

* * * * * *A * * * * * * * *B
* 1 * * * * * * * * * * 0082766
* 2 * * * * * * * * * * 0082767
* 3 * *0082768 * 0082768
* 4 * *0082768 * 0082768
* 5 * *0082768 * 0082768
* 6 * *0082768 * 0082768
* 7 * *0082768 * 0082768
* 8 * * * * * * * * * * 0104361
* 9 * * * * * * * * * * 0104365
10 * * * * * * * * * * 0104367
11 * * * * * * * * * * 0104368
12 * * * * * * * * * * 0104370
13 * 0104409 * *0104409
14 * 0104409 * *0104409


You posted in misc and I gave you a macro that was TESTED and DOES
work.
You said "it didn't work"
What does " it didn't work" mean. I tested. All you had to do was
change
mc = 2 to whatever column you are testing.

Sub copynumbersif()
Dim mc As Long
Dim i As Long
mc = 2
For i = 2 To Cells(Rows.Count, mc).End(xlUp).Row
If Cells(i - 1, mc) = Cells(i, mc) Then
Cells(i - 1, mc - 1) = Cells(i, mc)
Cells(i, mc - 1) = Cells(i, mc)
End If
Next i
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 621
Default Copy value

Go 'horns


Gord

On Mon, 7 Nov 2011 13:01:20 -0800 (PST), Don Guillett
wrote:

On Nov 7, 1:08*pm, gary wrote:
If B4 contains the same number as A3, how can I put the number in A4?

Here is my spreadsheet:

* * * * * * *A * * * * * * * *B
* 1 * * * * * * * * * * 0082766
* 2 * * * * * * * * * * 0082767
* 3 * *0082768 * 0082768
* 4 * * * * * * * * * * 0082768
* 5 * * * * * * * * * * 0082768
* 6 * * * * * * * * * * 0082768
* 7 * * * * * * * * * * 0082768
* 8 * * * * * * * * * * 0104361
* 9 * * * * * * * * * * 0104365
10 * * * * * * * * * * 0104367
11 * * * * * * * * * * 0104368
12 * * * * * * * * * * 0104370
13 * 0104409 * *0104409
14 * * * * * * * * * * 0104409

=========

This is the result I'm looking for:

* * * * * *A * * * * * * * *B
* 1 * * * * * * * * * * 0082766
* 2 * * * * * * * * * * 0082767
* 3 * *0082768 * 0082768
* 4 * *0082768 * 0082768
* 5 * *0082768 * 0082768
* 6 * *0082768 * 0082768
* 7 * *0082768 * 0082768
* 8 * * * * * * * * * * 0104361
* 9 * * * * * * * * * * 0104365
10 * * * * * * * * * * 0104367
11 * * * * * * * * * * 0104368
12 * * * * * * * * * * 0104370
13 * 0104409 * *0104409
14 * 0104409 * *0104409


You posted in misc and I gave you a macro that was TESTED and DOES
work.
You said "it didn't work"
What does " it didn't work" mean. I tested. All you had to do was
change
mc = 2 to whatever column you are testing.

Sub copynumbersif()
Dim mc As Long
Dim i As Long
mc = 2
For i = 2 To Cells(Rows.Count, mc).End(xlUp).Row
If Cells(i - 1, mc) = Cells(i, mc) Then
Cells(i - 1, mc - 1) = Cells(i, mc)
Cells(i, mc - 1) = Cells(i, mc)
End If
Next i
End Sub

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Copy value

On Nov 7, 1:09*pm, Gord Dibben wrote:
Go 'horns

Gord

On Mon, 7 Nov 2011 13:01:20 -0800 (PST), Don Guillett



wrote:
On Nov 7, 1:08*pm, gary wrote:
If B4 contains the same number as A3, how can I put the number in A4?


Here is my spreadsheet:


* * * * * * *A * * * * * * * *B
* 1 * * * * * * * * * * 0082766
* 2 * * * * * * * * * * 0082767
* 3 * *0082768 * 0082768
* 4 * * * * * * * * * * 0082768
* 5 * * * * * * * * * * 0082768
* 6 * * * * * * * * * * 0082768
* 7 * * * * * * * * * * 0082768
* 8 * * * * * * * * * * 0104361
* 9 * * * * * * * * * * 0104365
10 * * * * * * * * * * 0104367
11 * * * * * * * * * * 0104368
12 * * * * * * * * * * 0104370
13 * 0104409 * *0104409
14 * * * * * * * * * * 0104409


=========


This is the result I'm looking for:


* * * * * *A * * * * * * * *B
* 1 * * * * * * * * * * 0082766
* 2 * * * * * * * * * * 0082767
* 3 * *0082768 * 0082768
* 4 * *0082768 * 0082768
* 5 * *0082768 * 0082768
* 6 * *0082768 * 0082768
* 7 * *0082768 * 0082768
* 8 * * * * * * * * * * 0104361
* 9 * * * * * * * * * * 0104365
10 * * * * * * * * * * 0104367
11 * * * * * * * * * * 0104368
12 * * * * * * * * * * 0104370
13 * 0104409 * *0104409
14 * 0104409 * *0104409


You posted in misc and I gave you a macro that was TESTED and DOES
work.
You said "it didn't work"
What does " it didn't work" mean. I tested. All you had to do was
change
mc = 2 *to whatever column you are testing.


Sub copynumbersif()
Dim mc As Long
Dim i As Long
mc = 2
For i = 2 To Cells(Rows.Count, mc).End(xlUp).Row
If Cells(i - 1, mc) = Cells(i, mc) Then
Cells(i - 1, mc - 1) = Cells(i, mc)
Cells(i, mc - 1) = Cells(i, mc)
End If
Next i
End Sub- Hide quoted text -


- Show quoted text -


Here's more of my spreadsheet:


A B
0082655
0082657
0082657
0082657
0082669
0082669
0082669
0082698
0082698
0082698
0082715
0082715
0082715
0082716
0082716
0082716
0082717
0082717
0082717
0082728
0082728
0082728
0082763
0082765
0082765
0082765
0082766
0082767
0082768 0082768
0082768
0082768
0082768
0082768
0082769 0082769
0082769
0082769
0082769
0082769
0082770 0082770
0082770
0082770
0082770
0082770
0082771 0082771
0082771
0082771
0082771
0082771
0082789
0082789
0082789
0082793
0082794
0082795
0082796
0082797
0082797
0082797
0082800
0082800
0082800
0082811
0082811
0082811
0083855
0083859
0083859
0083859
0083864
0083864
0083865
0083865
0083865
0083867
0083867
0083868
0083868
0083868
0083870
0083873
0083873
0083874
0083874
0083874
0083875
0083875
0083875
0083876
0083876
0083876
0083877
0083877
0083877
0083878
0083878
0083878
0083879
0083879
0083879
0083880
0083880
0083880
0083881
0083881
0083881
0083882
0083882
0083882
0083883
0083884
0083884

In col A, only these numbers should appear (each 4 times):

0082768
0082769
0082770
0082771


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Copy value

On Nov 7, 1:09*pm, Gord Dibben wrote:
Go 'horns

Gord

On Mon, 7 Nov 2011 13:01:20 -0800 (PST), Don Guillett



wrote:
On Nov 7, 1:08*pm, gary wrote:
If B4 contains the same number as A3, how can I put the number in A4?


Here is my spreadsheet:


* * * * * * *A * * * * * * * *B
* 1 * * * * * * * * * * 0082766
* 2 * * * * * * * * * * 0082767
* 3 * *0082768 * 0082768
* 4 * * * * * * * * * * 0082768
* 5 * * * * * * * * * * 0082768
* 6 * * * * * * * * * * 0082768
* 7 * * * * * * * * * * 0082768
* 8 * * * * * * * * * * 0104361
* 9 * * * * * * * * * * 0104365
10 * * * * * * * * * * 0104367
11 * * * * * * * * * * 0104368
12 * * * * * * * * * * 0104370
13 * 0104409 * *0104409
14 * * * * * * * * * * 0104409


=========


This is the result I'm looking for:


* * * * * *A * * * * * * * *B
* 1 * * * * * * * * * * 0082766
* 2 * * * * * * * * * * 0082767
* 3 * *0082768 * 0082768
* 4 * *0082768 * 0082768
* 5 * *0082768 * 0082768
* 6 * *0082768 * 0082768
* 7 * *0082768 * 0082768
* 8 * * * * * * * * * * 0104361
* 9 * * * * * * * * * * 0104365
10 * * * * * * * * * * 0104367
11 * * * * * * * * * * 0104368
12 * * * * * * * * * * 0104370
13 * 0104409 * *0104409
14 * 0104409 * *0104409


You posted in misc and I gave you a macro that was TESTED and DOES
work.
You said "it didn't work"
What does " it didn't work" mean. I tested. All you had to do was
change
mc = 2 *to whatever column you are testing.


Sub copynumbersif()
Dim mc As Long
Dim i As Long
mc = 2
For i = 2 To Cells(Rows.Count, mc).End(xlUp).Row
If Cells(i - 1, mc) = Cells(i, mc) Then
Cells(i - 1, mc - 1) = Cells(i, mc)
Cells(i, mc - 1) = Cells(i, mc)
End If
Next i
End Sub- Hide quoted text -


- Show quoted text -


========================================

Here's more of my spreadsheet:

A B
0082655
0082657
0082657
0082657
0082669
0082669
0082669
0082698
0082698
0082698
0082715
0082715
0082715
0082716
0082716
0082716
0082717
0082717
0082717
0082728
0082728
0082728
0082763
0082765
0082765
0082765
0082766
0082767
0082768 0082768
0082768
0082768
0082768
0082768
0082769 0082769
0082769
0082769
0082769
0082769
0082770 0082770
0082770
0082770
0082770
0082770
0082771 0082771
0082771
0082771
0082771
0082771
0082789
0082789
0082789
0082793
0082794
0082795
0082796
0082797
0082797
0082797
0082800
0082800
0082800
0082811
0082811
0082811
0083855
0083859
0083859
0083859
0083864
0083864
0083865
0083865
0083865
0083867
0083867
0083868
0083868
0083868
0083870
0083873
0083873
0083874
0083874
0083874
0083875
0083875
0083875
0083876
0083876
0083876
0083877
0083877
0083877
0083878
0083878
0083878
0083879
0083879
0083879
0083880
0083880
0083880
0083881
0083881
0083881
0083882
0083882
0083882
0083883
0083884
0083884


In col A, only these numbers should appear (each 5 times):


0082768
0082769
0082770
0082771




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Copy value

On Nov 7, 3:09*pm, Gord Dibben wrote:
Go 'horns

Gord

On Mon, 7 Nov 2011 13:01:20 -0800 (PST), Don Guillett







wrote:
On Nov 7, 1:08*pm, gary wrote:
If B4 contains the same number as A3, how can I put the number in A4?


Here is my spreadsheet:


* * * * * * *A * * * * * * * *B
* 1 * * * * * * * * * * 0082766
* 2 * * * * * * * * * * 0082767
* 3 * *0082768 * 0082768
* 4 * * * * * * * * * * 0082768
* 5 * * * * * * * * * * 0082768
* 6 * * * * * * * * * * 0082768
* 7 * * * * * * * * * * 0082768
* 8 * * * * * * * * * * 0104361
* 9 * * * * * * * * * * 0104365
10 * * * * * * * * * * 0104367
11 * * * * * * * * * * 0104368
12 * * * * * * * * * * 0104370
13 * 0104409 * *0104409
14 * * * * * * * * * * 0104409


=========


This is the result I'm looking for:


* * * * * *A * * * * * * * *B
* 1 * * * * * * * * * * 0082766
* 2 * * * * * * * * * * 0082767
* 3 * *0082768 * 0082768
* 4 * *0082768 * 0082768
* 5 * *0082768 * 0082768
* 6 * *0082768 * 0082768
* 7 * *0082768 * 0082768
* 8 * * * * * * * * * * 0104361
* 9 * * * * * * * * * * 0104365
10 * * * * * * * * * * 0104367
11 * * * * * * * * * * 0104368
12 * * * * * * * * * * 0104370
13 * 0104409 * *0104409
14 * 0104409 * *0104409


You posted in misc and I gave you a macro that was TESTED and DOES
work.
You said "it didn't work"
What does " it didn't work" mean. I tested. All you had to do was
change
mc = 2 *to whatever column you are testing.


Sub copynumbersif()
Dim mc As Long
Dim i As Long
mc = 2
For i = 2 To Cells(Rows.Count, mc).End(xlUp).Row
If Cells(i - 1, mc) = Cells(i, mc) Then
Cells(i - 1, mc - 1) = Cells(i, mc)
Cells(i, mc - 1) = Cells(i, mc)
End If
Next i
End Sub


Gord, Thanks. Looks like the University of Texas football team is on
the right track back and will be playing "power football" . BTW,it's
"Hook em horns" Come see me in Austin.
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 621
Default Copy value

"Hook 'em horns"

I'll remember that Don.

Not much chance of me getting to Austin.

With my list of health issues over the past 6 years my travel
insurance cost could equal your national debt.



On Mon, 7 Nov 2011 15:35:26 -0800 (PST), Don Guillett
wrote:

Gord, Thanks. Looks like the University of Texas football team is on
the right track back and will be playing "power football" . BTW,it's
"Hook em horns" Come see me in Austin.

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Copy value

With my list of health issues over the past 6 years my travel
insurance cost could equal your national debt.


Damn ! I'd put all my money to us bonds !
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
copy method of worksheet class failed: trying to copy a hidden she sam Excel Programming 4 August 8th 09 11:19 PM
copy method of worksheet class failed: trying to copy a hidden she sam Excel Programming 0 August 7th 09 11:16 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
copy formulas from a contiguous range to a safe place and copy them back later Lucas Budlong Excel Programming 2 February 22nd 06 08:26 PM
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM


All times are GMT +1. The time now is 02:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"