I have 20 rows,
if the first row is the 5th row e.g.A5 or B5,
then I want Y5 = "GM" ETC.ETC.
So something like:
Y(Cells(Rows.Count, 1).End(xlUp).Row)= "GM"
obviously not End(xlUp).Row but something similar
Thks
I have 20 rows,
if the first row is the 5th row e.g.A5 or B5,
then I want Y5 = "GM" ETC.ETC.
So something like:
Y(Cells(Rows.Count, 1).End(xlUp).Row)= "GM"
obviously not End(xlUp).Row but something similar
Thks
Range("Y" & Cells(Rows.Count, 1).End(xlUp).Row).Value = "GM"
--
Regards,
Tom Ogilvy
"teresa" <teresa@discussions.microsoft.com> wrote in message
news:085605D3-7639-48E9-A167-21C8B043786A@microsoft.com...
> I have 20 rows,
>
>
> if the first row is the 5th row e.g.A5 or B5,
> then I want Y5 = "GM" ETC.ETC.
>
> So something like:
>
> Y(Cells(Rows.Count, 1).End(xlUp).Row)= "GM"
>
> obviously not End(xlUp).Row but something similar
>
> Thks
>
>
>
Tom Ogilvy wrote:
> Range("Y" & Cells(Rows.Count, 1).End(xlUp).Row).Value = "GM"
>
Doesn't do it; if you want the first row in Column A to control try
Range("Y" & Range("A1").End(xlDown).Row).Value = "GM"
If you want Column B to control, change the A1 to B1
Alan Beban
Thanks, misread the question.
--
Regards,
Tom Ogilvy
"Alan Beban" <unavailable@no.com> wrote in message
news:%23NYkhRB%23EHA.3872@TK2MSFTNGP10.phx.gbl...
> Tom Ogilvy wrote:
> > Range("Y" & Cells(Rows.Count, 1).End(xlUp).Row).Value = "GM"
> >
> Doesn't do it; if you want the first row in Column A to control try
>
> Range("Y" & Range("A1").End(xlDown).Row).Value = "GM"
>
> If you want Column B to control, change the A1 to B1
>
> Alan Beban
Alan Beban wrote:
> Tom Ogilvy wrote:
>
>> Range("Y" & Cells(Rows.Count, 1).End(xlUp).Row).Value = "GM"
>>
> Doesn't do it; if you want the first row in Column A to control try
>
> Range("Y" & Range("A1").End(xlDown).Row).Value = "GM"
>
> If you want Column B to control, change the A1 to B1
>
> Alan Beban
And if it isn't known whether Column A or B should be the control, one
might try
Range("Y" & Application.Min(Range("A1").End(xlDown).Row, _
Range("B1").End(xlDown).Row)).Value = "GM"
Alan Beban
"Alan Beban" <unavailable@no.com> wrote...
....
>Doesn't do it; if you want the first row in Column A to control try
>
>Range("Y" & Range("A1").End(xlDown).Row).Value = "GM"
>
>If you want Column B to control, change the A1 to B1
Doesn't work if A1 (or B1) is the only nonblank cell in its column. And if
A1:A# were all nonblank, this would give the bottommost row in that range of
nonblank cells.
If col A should control, shouldn't this be
Range("Y" & IIf(IsEmpty(Range("A1").Value), _
Range("A1").End(xlDown).Row, 1)).Value = "GM"
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks