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 Dibben
Guest
Posts: n/a
's Computer Specifications
7th Nov 2011
Go 'horns
Gord
On Mon, 7 Nov 2011 13:01:20 -0800 (PST), Don Guillett
<(E-Mail Removed)> wrote:
>On Nov 7, 1:08*pm, gary <gcott...@hotmail.com> 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
>
gary
Guest
Posts: n/a
's Computer Specifications
7th Nov 2011
On Nov 7, 1:09*pm, Gord Dibben <phnor...@shaw.ca> wrote:
> Go 'horns
>
> Gord
>
> On Mon, 7 Nov 2011 13:01:20 -0800 (PST), Don Guillett
>
>
>
> <dguille...@gmail.com> wrote:
> >On Nov 7, 1:08*pm, gary <gcott...@hotmail.com> 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 -
In col A, only these numbers should appear (each 5 times):
0082768
0082769
0082770
0082771
Don Guillett
Guest
Posts: n/a
's Computer Specifications
7th Nov 2011
On Nov 7, 3:09*pm, Gord Dibben <phnor...@shaw.ca> wrote:
> Go 'horns
>
> Gord
>
> On Mon, 7 Nov 2011 13:01:20 -0800 (PST), Don Guillett
>
>
>
>
>
>
>
> <dguille...@gmail.com> wrote:
> >On Nov 7, 1:08*pm, gary <gcott...@hotmail.com> 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.
Gord Dibben
Guest
Posts: n/a
's Computer Specifications
8th Nov 2011
"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
<(E-Mail Removed)> 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.
rumkus@hotmail.com
Guest
Posts: n/a
's Computer Specifications
8th Nov 2011
> With my list of health issues over the past 6 years my travel
> insurance cost could equal your national debt.