[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.excel.programming

RE: Expected End With..

John Bundy

12/14/2006 4:26:00 PM

Microsoft is bad with these errors, it is almost certainly not your With
statement. Post the code and we'll see
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Donna C" wrote:

> I keep getting a compile error that says
> Expected End With
> I can't seem to figure whats going on.
> Any Suggestions???
> Thanks in advance
> Donna C.
>
8 Answers

theSquirrel

12/14/2006 5:03:00 PM

0

I would expect that you either need to remove the End With if there is
opening with statement. In the code that you posted, there is no
opening With statement.

I would suggest removing the end with.

theSquirrel


Donna C wrote:
> Here it is.
> Cells.Select
> Selection.RowHeight = 31.5
>
>
> Rows("5:5").Select
> Selection.RowHeight = 40.5
> Rows("26:26").Select
> Selection.RowHeight = 40.5
> Rows("47:47").Select
> Selection.RowHeight = 40.5
> Rows("68:68").Select
> Selection.RowHeight = 40.5
> Rows("89:89").Select
> Selection.RowHeight = 40.5
> Rows("110:110").Select
> Selection.RowHeight = 40.5
> Rows("131:131").Select
> Selection.RowHeight = 40.5
> End With
> End Sub
> "John Bundy" wrote:
>
> > Microsoft is bad with these errors, it is almost certainly not your With
> > statement. Post the code and we'll see
> > --
> > -John
> > Please rate when your question is answered to help us and others know what
> > is helpful.
> >
> >
> > "Donna C" wrote:
> >
> > > I keep getting a compile error that says
> > > Expected End With
> > > I can't seem to figure whats going on.
> > > Any Suggestions???
> > > Thanks in advance
> > > Donna C.
> > >

keri

12/14/2006 5:03:00 PM

0

You haven't posted the beginning of your code but the rule is that you
need to have an End With statement for every statement that starts with
"with" in your code.

So if you have 2 lines in your code that start with the word With then
you need 2 lines at the end of your code that say End With.

Someone more experienced should clarify this though.

Don Guillett

12/14/2006 5:12:00 PM

0

You had an "End With" at the end without a with at the start. All you need
is this


Cells.RowHeight = 31.5
Range("a5,a26,a47,a68,a89,a110,a131") _
.EntireRow.RowHeight = 40.5

' End With
End Sub

--
Don Guillett
SalesAid Software
dguillett1@austin.rr.com
"Donna C" <DonnaC@discussions.microsoft.com> wrote in message
news:2B0ECB1F-4FA2-4491-86B1-154C2A35E307@microsoft.com...
> Here it is.
> Cells.Select
> Selection.RowHeight = 31.5
>
>
> Rows("5:5").Select
> Selection.RowHeight = 40.5
> Rows("26:26").Select
> Selection.RowHeight = 40.5
> Rows("47:47").Select
> Selection.RowHeight = 40.5
> Rows("68:68").Select
> Selection.RowHeight = 40.5
> Rows("89:89").Select
> Selection.RowHeight = 40.5
> Rows("110:110").Select
> Selection.RowHeight = 40.5
> Rows("131:131").Select
> Selection.RowHeight = 40.5
> End With
> End Sub
> "John Bundy" wrote:
>
>> Microsoft is bad with these errors, it is almost certainly not your With
>> statement. Post the code and we'll see
>> --
>> -John
>> Please rate when your question is answered to help us and others know
>> what
>> is helpful.
>>
>>
>> "Donna C" wrote:
>>
>> > I keep getting a compile error that says
>> > Expected End With
>> > I can't seem to figure whats going on.
>> > Any Suggestions???
>> > Thanks in advance
>> > Donna C.
>> >


Don Guillett

12/14/2006 5:20:00 PM

0

or, from anywhere in the workbook. Notice the . placement

with worksheets("myworksheet")
..Cells.RowHeight = 31.5
..Range("a5,a26,a47,a68,a89,a110,a131").EntireRow.RowHeight = 40.5
End With


--
Don Guillett
SalesAid Software
dguillett1@austin.rr.com
"Don Guillett" <dguillett1@austin.rr.com> wrote in message
news:%23HMsCM6HHHA.3668@TK2MSFTNGP02.phx.gbl...
> You had an "End With" at the end without a with at the start. All you need
> is this
>
>
> Cells.RowHeight = 31.5
> Range("a5,a26,a47,a68,a89,a110,a131") _
> .EntireRow.RowHeight = 40.5
>
> ' End With
> End Sub
>
> --
> Don Guillett
> SalesAid Software
> dguillett1@austin.rr.com
> "Donna C" <DonnaC@discussions.microsoft.com> wrote in message
> news:2B0ECB1F-4FA2-4491-86B1-154C2A35E307@microsoft.com...
>> Here it is.
>> Cells.Select
>> Selection.RowHeight = 31.5
>>
>>
>> Rows("5:5").Select
>> Selection.RowHeight = 40.5
>> Rows("26:26").Select
>> Selection.RowHeight = 40.5
>> Rows("47:47").Select
>> Selection.RowHeight = 40.5
>> Rows("68:68").Select
>> Selection.RowHeight = 40.5
>> Rows("89:89").Select
>> Selection.RowHeight = 40.5
>> Rows("110:110").Select
>> Selection.RowHeight = 40.5
>> Rows("131:131").Select
>> Selection.RowHeight = 40.5
>> End With
>> End Sub
>> "John Bundy" wrote:
>>
>>> Microsoft is bad with these errors, it is almost certainly not your With
>>> statement. Post the code and we'll see
>>> --
>>> -John
>>> Please rate when your question is answered to help us and others know
>>> what
>>> is helpful.
>>>
>>>
>>> "Donna C" wrote:
>>>
>>> > I keep getting a compile error that says
>>> > Expected End With
>>> > I can't seem to figure whats going on.
>>> > Any Suggestions???
>>> > Thanks in advance
>>> > Donna C.
>>> >
>
>


Donna C

12/14/2006 5:20:00 PM

0

This is the beginning of my sub,
then the rest follows.
Hope this clarifies.
You have to excuse me but I'm a rookie at this.
Kinda seat of the pants thing.
Thanks in advance.
Donna C.
Sub New1()
Range("A:A,H:H,O:O,V:V").ColumnWidth = 20
Range("B:B,I:I,P:P,W:W").ColumnWidth = 12
Range("C:C,D:D,G:G,J:J,K:K,N:N").ColumnWidth = 2
Range("Q:Q,R:R,U:U,X:X,Y:Y,AB:AB").ColumnWidth = 2
Range("E:E,L:L,S:S,Z:Z").ColumnWidth = 25
Range("F:F,M:M,T:T,AA:AA").ColumnWidth = 14

"keri" wrote:

> You haven't posted the beginning of your code but the rule is that you
> need to have an End With statement for every statement that starts with
> "with" in your code.
>
> So if you have 2 lines in your code that start with the word With then
> you need 2 lines at the end of your code that say End With.
>
> Someone more experienced should clarify this though.
>
>

Bob Phillips

12/14/2006 5:48:00 PM

0

I get a No With error.

This works

Cells.RowHeight = 31.5
Rows("5:5").RowHeight = 40.5
Rows("26:26").RowHeight = 40.5
Rows("47:47").RowHeight = 40.5
Rows("68:68").RowHeight = 40.5
Rows("89:89").RowHeight = 40.5
Rows("110:110").RowHeight = 40.5
Rows("131:131").RowHeight = 40.5


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Donna C" <DonnaC@discussions.microsoft.com> wrote in message
news:2B0ECB1F-4FA2-4491-86B1-154C2A35E307@microsoft.com...
> Here it is.
> Cells.Select
> Selection.RowHeight = 31.5
>
>
> Rows("5:5").Select
> Selection.RowHeight = 40.5
> Rows("26:26").Select
> Selection.RowHeight = 40.5
> Rows("47:47").Select
> Selection.RowHeight = 40.5
> Rows("68:68").Select
> Selection.RowHeight = 40.5
> Rows("89:89").Select
> Selection.RowHeight = 40.5
> Rows("110:110").Select
> Selection.RowHeight = 40.5
> Rows("131:131").Select
> Selection.RowHeight = 40.5
> End With
> End Sub
> "John Bundy" wrote:
>
> > Microsoft is bad with these errors, it is almost certainly not your With
> > statement. Post the code and we'll see
> > --
> > -John
> > Please rate when your question is answered to help us and others know
what
> > is helpful.
> >
> >
> > "Donna C" wrote:
> >
> > > I keep getting a compile error that says
> > > Expected End With
> > > I can't seem to figure whats going on.
> > > Any Suggestions???
> > > Thanks in advance
> > > Donna C.
> > >


Donna C

12/14/2006 6:47:00 PM

0

Thank you ,that really helped.
Donna C.

"Don Guillett" wrote:

> or, from anywhere in the workbook. Notice the . placement
>
> with worksheets("myworksheet")
> ..Cells.RowHeight = 31.5
> ..Range("a5,a26,a47,a68,a89,a110,a131").EntireRow.RowHeight = 40.5
> End With
>
>
> --
> Don Guillett
> SalesAid Software
> dguillett1@austin.rr.com
> "Don Guillett" <dguillett1@austin.rr.com> wrote in message
> news:%23HMsCM6HHHA.3668@TK2MSFTNGP02.phx.gbl...
> > You had an "End With" at the end without a with at the start. All you need
> > is this
> >
> >
> > Cells.RowHeight = 31.5
> > Range("a5,a26,a47,a68,a89,a110,a131") _
> > .EntireRow.RowHeight = 40.5
> >
> > ' End With
> > End Sub
> >
> > --
> > Don Guillett
> > SalesAid Software
> > dguillett1@austin.rr.com
> > "Donna C" <DonnaC@discussions.microsoft.com> wrote in message
> > news:2B0ECB1F-4FA2-4491-86B1-154C2A35E307@microsoft.com...
> >> Here it is.
> >> Cells.Select
> >> Selection.RowHeight = 31.5
> >>
> >>
> >> Rows("5:5").Select
> >> Selection.RowHeight = 40.5
> >> Rows("26:26").Select
> >> Selection.RowHeight = 40.5
> >> Rows("47:47").Select
> >> Selection.RowHeight = 40.5
> >> Rows("68:68").Select
> >> Selection.RowHeight = 40.5
> >> Rows("89:89").Select
> >> Selection.RowHeight = 40.5
> >> Rows("110:110").Select
> >> Selection.RowHeight = 40.5
> >> Rows("131:131").Select
> >> Selection.RowHeight = 40.5
> >> End With
> >> End Sub
> >> "John Bundy" wrote:
> >>
> >>> Microsoft is bad with these errors, it is almost certainly not your With
> >>> statement. Post the code and we'll see
> >>> --
> >>> -John
> >>> Please rate when your question is answered to help us and others know
> >>> what
> >>> is helpful.
> >>>
> >>>
> >>> "Donna C" wrote:
> >>>
> >>> > I keep getting a compile error that says
> >>> > Expected End With
> >>> > I can't seem to figure whats going on.
> >>> > Any Suggestions???
> >>> > Thanks in advance
> >>> > Donna C.
> >>> >
> >
> >
>
>
>

Don Guillett

12/14/2006 7:28:00 PM

0

Glad to help.

--
Don Guillett
SalesAid Software
dguillett1@austin.rr.com
"Donna C" <DonnaC@discussions.microsoft.com> wrote in message
news:76AD41F5-0D5B-4DAA-A6AB-A9CC587EC6A9@microsoft.com...
> Thank you ,that really helped.
> Donna C.
>
> "Don Guillett" wrote:
>
>> or, from anywhere in the workbook. Notice the . placement
>>
>> with worksheets("myworksheet")
>> ..Cells.RowHeight = 31.5
>> ..Range("a5,a26,a47,a68,a89,a110,a131").EntireRow.RowHeight = 40.5
>> End With
>>
>>
>> --
>> Don Guillett
>> SalesAid Software
>> dguillett1@austin.rr.com
>> "Don Guillett" <dguillett1@austin.rr.com> wrote in message
>> news:%23HMsCM6HHHA.3668@TK2MSFTNGP02.phx.gbl...
>> > You had an "End With" at the end without a with at the start. All you
>> > need
>> > is this
>> >
>> >
>> > Cells.RowHeight = 31.5
>> > Range("a5,a26,a47,a68,a89,a110,a131") _
>> > .EntireRow.RowHeight = 40.5
>> >
>> > ' End With
>> > End Sub
>> >
>> > --
>> > Don Guillett
>> > SalesAid Software
>> > dguillett1@austin.rr.com
>> > "Donna C" <DonnaC@discussions.microsoft.com> wrote in message
>> > news:2B0ECB1F-4FA2-4491-86B1-154C2A35E307@microsoft.com...
>> >> Here it is.
>> >> Cells.Select
>> >> Selection.RowHeight = 31.5
>> >>
>> >>
>> >> Rows("5:5").Select
>> >> Selection.RowHeight = 40.5
>> >> Rows("26:26").Select
>> >> Selection.RowHeight = 40.5
>> >> Rows("47:47").Select
>> >> Selection.RowHeight = 40.5
>> >> Rows("68:68").Select
>> >> Selection.RowHeight = 40.5
>> >> Rows("89:89").Select
>> >> Selection.RowHeight = 40.5
>> >> Rows("110:110").Select
>> >> Selection.RowHeight = 40.5
>> >> Rows("131:131").Select
>> >> Selection.RowHeight = 40.5
>> >> End With
>> >> End Sub
>> >> "John Bundy" wrote:
>> >>
>> >>> Microsoft is bad with these errors, it is almost certainly not your
>> >>> With
>> >>> statement. Post the code and we'll see
>> >>> --
>> >>> -John
>> >>> Please rate when your question is answered to help us and others know
>> >>> what
>> >>> is helpful.
>> >>>
>> >>>
>> >>> "Donna C" wrote:
>> >>>
>> >>> > I keep getting a compile error that says
>> >>> > Expected End With
>> >>> > I can't seem to figure whats going on.
>> >>> > Any Suggestions???
>> >>> > Thanks in advance
>> >>> > Donna C.
>> >>> >
>> >
>> >
>>
>>
>>