PC Review


Reply
Thread Tools Rate Thread

brain dead today - resize problem

 
 
Susan
Guest
Posts: n/a
 
      11th Apr 2007
i'm KNOW this is an easy fix, but i just can't find it this
morning...........

Private Sub Worksheet_Change(ByVal Target As Range)

Dim ws As Worksheet
Dim rTarget As Range
Dim rColorSet As Range
Dim lRow As Long

lRow = ActiveCell.Row
Set ws = ActiveSheet
Set Target = ws.Range("n" & lRow)
Set rTarget = ws.Range("d" & lRow)
Set rColorSet = ws.Range("a:ak" & lRow).Resize(1, 0)

If Target = "" And rTarget = "" Then
rColorSet.Interior.Color = 2
End If

If Target <> "" And rTarget = "" Then
rColorSet.Interior.Color = 16
End If

If Target <> "" And rTarget <> "" Then
rColorSet.Interior.Color = 2
End If

End Sub


on this row:

Set rColorSet = ws.Range("a:ak" & lRow).Resize(1, 0)

i keep getting a 1004 error - method range of object worksheet railed.
i looked at a zillion .resize posts but i can't see the
error..........
anybody?
thanks a zillion!
susan

 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      11th Apr 2007
>>ws.Range("a:ak" & lRow).

Both the "a" and the "ak" need lrow.

--
Jim
"Susan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
| i'm KNOW this is an easy fix, but i just can't find it this
| morning...........
|
| Private Sub Worksheet_Change(ByVal Target As Range)
|
| Dim ws As Worksheet
| Dim rTarget As Range
| Dim rColorSet As Range
| Dim lRow As Long
|
| lRow = ActiveCell.Row
| Set ws = ActiveSheet
| Set Target = ws.Range("n" & lRow)
| Set rTarget = ws.Range("d" & lRow)
| Set rColorSet = ws.Range("a:ak" & lRow).Resize(1, 0)
|
| If Target = "" And rTarget = "" Then
| rColorSet.Interior.Color = 2
| End If
|
| If Target <> "" And rTarget = "" Then
| rColorSet.Interior.Color = 16
| End If
|
| If Target <> "" And rTarget <> "" Then
| rColorSet.Interior.Color = 2
| End If
|
| End Sub
|
|
| on this row:
|
| Set rColorSet = ws.Range("a:ak" & lRow).Resize(1, 0)
|
| i keep getting a 1004 error - method range of object worksheet railed.
| i looked at a zillion .resize posts but i can't see the
| error..........
| anybody?
| thanks a zillion!
| susan
|


 
Reply With Quote
 
Gary Keramidas
Guest
Posts: n/a
 
      11th Apr 2007
a row number after the first a.

--


Gary


"Susan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> i'm KNOW this is an easy fix, but i just can't find it this
> morning...........
>
> Private Sub Worksheet_Change(ByVal Target As Range)
>
> Dim ws As Worksheet
> Dim rTarget As Range
> Dim rColorSet As Range
> Dim lRow As Long
>
> lRow = ActiveCell.Row
> Set ws = ActiveSheet
> Set Target = ws.Range("n" & lRow)
> Set rTarget = ws.Range("d" & lRow)
> Set rColorSet = ws.Range("a:ak" & lRow).Resize(1, 0)
>
> If Target = "" And rTarget = "" Then
> rColorSet.Interior.Color = 2
> End If
>
> If Target <> "" And rTarget = "" Then
> rColorSet.Interior.Color = 16
> End If
>
> If Target <> "" And rTarget <> "" Then
> rColorSet.Interior.Color = 2
> End If
>
> End Sub
>
>
> on this row:
>
> Set rColorSet = ws.Range("a:ak" & lRow).Resize(1, 0)
>
> i keep getting a 1004 error - method range of object worksheet railed.
> i looked at a zillion .resize posts but i can't see the
> error..........
> anybody?
> thanks a zillion!
> susan
>



 
Reply With Quote
 
Bernd
Guest
Posts: n/a
 
      11th Apr 2007
And 2nd param of Resize() should not be 0, I suggest.

Regards,
Bernd

 
Reply With Quote
 
Susan
Guest
Posts: n/a
 
      11th Apr 2007
thank you very much, gary & jim!!!
susan

On Apr 11, 10:04 am, "Jim Rech" <jrr...@hotmail.com> wrote:
> >>ws.Range("a:ak" & lRow).

>
> Both the "a" and the "ak" need lrow.
>
> --
> Jim"Susan" <bogenex...@aol.com> wrote in message
>
> news:(E-Mail Removed)...
> | i'm KNOW this is an easy fix, but i just can't find it this
> | morning...........
> |
> | Private Sub Worksheet_Change(ByVal Target As Range)
> |
> | Dim ws As Worksheet
> | Dim rTarget As Range
> | Dim rColorSet As Range
> | Dim lRow As Long
> |
> | lRow = ActiveCell.Row
> | Set ws = ActiveSheet
> | Set Target = ws.Range("n" & lRow)
> | Set rTarget = ws.Range("d" & lRow)
> | Set rColorSet = ws.Range("a:ak" & lRow).Resize(1, 0)
> |
> | If Target = "" And rTarget = "" Then
> | rColorSet.Interior.Color = 2
> | End If
> |
> | If Target <> "" And rTarget = "" Then
> | rColorSet.Interior.Color = 16
> | End If
> |
> | If Target <> "" And rTarget <> "" Then
> | rColorSet.Interior.Color = 2
> | End If
> |
> | End Sub
> |
> |
> | on this row:
> |
> | Set rColorSet = ws.Range("a:ak" & lRow).Resize(1, 0)
> |
> | i keep getting a 1004 error - method range of object worksheet railed.
> | i looked at a zillion .resize posts but i can't see the
> | error..........
> | anybody?
> | thanks a zillion!
> | susan
> |



 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      11th Apr 2007
After you fix the row problem,
I would add that I don't believe you can have zero as an argument to resize.
So either leave one of the arguments blank or make the appropriate
adjustment.

--
Regards,
Tom Ogilvy


"Susan" wrote:

> i'm KNOW this is an easy fix, but i just can't find it this
> morning...........
>
> Private Sub Worksheet_Change(ByVal Target As Range)
>
> Dim ws As Worksheet
> Dim rTarget As Range
> Dim rColorSet As Range
> Dim lRow As Long
>
> lRow = ActiveCell.Row
> Set ws = ActiveSheet
> Set Target = ws.Range("n" & lRow)
> Set rTarget = ws.Range("d" & lRow)
> Set rColorSet = ws.Range("a:ak" & lRow).Resize(1, 0)
>
> If Target = "" And rTarget = "" Then
> rColorSet.Interior.Color = 2
> End If
>
> If Target <> "" And rTarget = "" Then
> rColorSet.Interior.Color = 16
> End If
>
> If Target <> "" And rTarget <> "" Then
> rColorSet.Interior.Color = 2
> End If
>
> End Sub
>
>
> on this row:
>
> Set rColorSet = ws.Range("a:ak" & lRow).Resize(1, 0)
>
> i keep getting a 1004 error - method range of object worksheet railed.
> i looked at a zillion .resize posts but i can't see the
> error..........
> anybody?
> thanks a zillion!
> susan
>
>

 
Reply With Quote
 
Susan
Guest
Posts: n/a
 
      11th Apr 2007
thanks, tom & bernd, cuz i was just about to post back after banging
my head against the wall some more!!!!
susan


On Apr 11, 10:20 am, Tom Ogilvy <TomOgi...@discussions.microsoft.com>
wrote:
> After you fix the row problem,
> I would add that I don't believe you can have zero as an argument to resize.
> So either leave one of the arguments blank or make the appropriate
> adjustment.
>
> --
> Regards,
> Tom Ogilvy
>
>
>
> "Susan" wrote:
> > i'm KNOW this is an easy fix, but i just can't find it this
> > morning...........

>
> > Private Sub Worksheet_Change(ByVal Target As Range)

>
> > Dim ws As Worksheet
> > Dim rTarget As Range
> > Dim rColorSet As Range
> > Dim lRow As Long

>
> > lRow = ActiveCell.Row
> > Set ws = ActiveSheet
> > Set Target = ws.Range("n" & lRow)
> > Set rTarget = ws.Range("d" & lRow)
> > Set rColorSet = ws.Range("a:ak" & lRow).Resize(1, 0)

>
> > If Target = "" And rTarget = "" Then
> > rColorSet.Interior.Color = 2
> > End If

>
> > If Target <> "" And rTarget = "" Then
> > rColorSet.Interior.Color = 16
> > End If

>
> > If Target <> "" And rTarget <> "" Then
> > rColorSet.Interior.Color = 2
> > End If

>
> > End Sub

>
> > on this row:

>
> > Set rColorSet = ws.Range("a:ak" & lRow).Resize(1, 0)

>
> > i keep getting a 1004 error - method range of object worksheet railed.
> > i looked at a zillion .resize posts but i can't see the
> > error..........
> > anybody?
> > thanks a zillion!
> > susan- Hide quoted text -

>
> - Show quoted text -



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help am Brain Dead today. =?Utf-8?B?S2hhbmpvaG4=?= Microsoft Excel Programming 5 17th Apr 2007 01:56 PM
Brain Dead CBrausa Microsoft Excel Misc 3 16th Aug 2006 02:50 PM
Brain Dead: Need help with ???? WarrenC Microsoft Excel Worksheet Functions 3 25th Jul 2006 08:11 AM
ole object brain dead Husky Microsoft Access 4 21st Dec 2005 01:20 AM
Brain Dead with DSL problem Josh Windows XP General 3 17th Oct 2003 08:12 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:47 AM.