Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default Overflow Problem

Hey guys-
Got this code from the net, seems to work fine until now. I'm getting an
Error 6 Overflow problem. I don't understand VB much at all, so can someone
point me along the way?
Thanks
D

Sub Step4()
' ProperCase Macro
Dim c As Range
With ActiveSheet
For Each c In .UsedRange
c.Value = Application.WorksheetFunction.Proper(c.Value)
Next
End With

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default Overflow Problem

I would assume that this is because the worksheet
UsedRange is too large and the loop attempts to execute on
each cell in the UsedRange. Debra Dalgleish describes this
issue and how to fix it at:

http://www.contextures.com/xlfaqApp.html#Unused

Note that the worksheet UsedRange property is not IMO the
best option for this. There are other ways to establish
the range(s) on which to run the macro, both fixed and
dynamic. You would need to provide a definition of the
ranges first.

Regards,
Greg

-----Original Message-----
Hey guys-
Got this code from the net, seems to work fine until now.

I'm getting an
Error 6 Overflow problem. I don't understand VB much at

all, so can someone
point me along the way?
Thanks
D

Sub Step4()
' ProperCase Macro
Dim c As Range
With ActiveSheet
For Each c In .UsedRange
c.Value = Application.WorksheetFunction.Proper

(c.Value)
Next
End With

End Sub


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Overflow Problem

This might help :-


Code
-------------------

If Application.WorksheetFunction.IsText(c.Value) Then
c.Value = Application.WorksheetFunction.Proper(c.Value)
End If

-------------------


--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,718
Default Overflow Problem

See if this is better:

Sub ConvertUsedRgToProperCase()
Dim Cell As Range
On Error GoTo EndThis
For Each Cell In ActiveSheet.UsedRange.SpecialCells(xlCellTypeConst ants,
xlTextValues)
Cell.Value = StrConv(Cell.Value, vbProperCase)
Next
EndThis:
End Sub

--
Jim Rech
Excel MVP
"D" wrote in message news:pJiSc.26663$Oi.7755@fed1read04...
| Hey guys-
| Got this code from the net, seems to work fine until now. I'm getting an
| Error 6 Overflow problem. I don't understand VB much at all, so can
someone
| point me along the way?
| Thanks
| D
|
| Sub Step4()
| ' ProperCase Macro
| Dim c As Range
| With ActiveSheet
| For Each c In .UsedRange
| c.Value = Application.WorksheetFunction.Proper(c.Value)
| Next
| End With
|
| End Sub
|
|


  #5   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default Overflow Problem

Jim- Thank you for the response and code... I'm getting a syntax error on
the

For Each Cell In ActiveSheet.UsedRange.SpecialCells(xlCellTypeConst ants,
xlTextValues)

Any ideas? I don't see it...
Thanks!
D

"Jim Rech" wrote in message
...
See if this is better:

Sub ConvertUsedRgToProperCase()
Dim Cell As Range
On Error GoTo EndThis
For Each Cell In

ActiveSheet.UsedRange.SpecialCells(xlCellTypeConst ants,
xlTextValues)
Cell.Value = StrConv(Cell.Value, vbProperCase)
Next
EndThis:
End Sub

--
Jim Rech
Excel MVP
"D" wrote in message news:pJiSc.26663$Oi.7755@fed1read04...
| Hey guys-
| Got this code from the net, seems to work fine until now. I'm getting an
| Error 6 Overflow problem. I don't understand VB much at all, so can
someone
| point me along the way?
| Thanks
| D
|
| Sub Step4()
| ' ProperCase Macro
| Dim c As Range
| With ActiveSheet
| For Each c In .UsedRange
| c.Value = Application.WorksheetFunction.Proper(c.Value)
| Next
| End With
|
| End Sub
|
|






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Overflow Problem

Nope- adding this code STILL throws an overflow problem on the c.Value part
of line:
If Application.WorksheetFunction.IsText(c.Value) Then

"BrianB " wrote in message
...
This might help :-


Code:
--------------------

If Application.WorksheetFunction.IsText(c.Value) Then
c.Value = Application.WorksheetFunction.Proper(c.Value)
End If

--------------------



---
Message posted from http://www.ExcelForum.com/



  #7   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7,247
Default Overflow Problem

The code should be on a single line, or split using the line
continuation character _. E.g.,

For Each Cell In ActiveSheet.UsedRange.SpecialCells( _
xlCellTypeConstants, xlTextValues)



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"D" wrote in message
news:DZrSc.26686$Oi.14208@fed1read04...
Jim- Thank you for the response and code... I'm getting a

syntax error on
the

For Each Cell In

ActiveSheet.UsedRange.SpecialCells(xlCellTypeConst ants,
xlTextValues)

Any ideas? I don't see it...
Thanks!
D

"Jim Rech" wrote in message
...
See if this is better:

Sub ConvertUsedRgToProperCase()
Dim Cell As Range
On Error GoTo EndThis
For Each Cell In

ActiveSheet.UsedRange.SpecialCells(xlCellTypeConst ants,
xlTextValues)
Cell.Value = StrConv(Cell.Value, vbProperCase)
Next
EndThis:
End Sub

--
Jim Rech
Excel MVP
"D" wrote in message

news:pJiSc.26663$Oi.7755@fed1read04...
| Hey guys-
| Got this code from the net, seems to work fine until now.

I'm getting an
| Error 6 Overflow problem. I don't understand VB much at

all, so can
someone
| point me along the way?
| Thanks
| D
|
| Sub Step4()
| ' ProperCase Macro
| Dim c As Range
| With ActiveSheet
| For Each c In .UsedRange
| c.Value = Application.WorksheetFunction.Proper(c.Value)
| Next
| End With
|
| End Sub
|
|






  #8   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default Overflow Problem

SAWEET!!! IT WORKS!!! THANK YOU! THANK YOU!!!

D

"Chip Pearson" wrote in message
...
The code should be on a single line, or split using the line
continuation character _. E.g.,

For Each Cell In ActiveSheet.UsedRange.SpecialCells( _
xlCellTypeConstants, xlTextValues)



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"D" wrote in message
news:DZrSc.26686$Oi.14208@fed1read04...
Jim- Thank you for the response and code... I'm getting a

syntax error on
the

For Each Cell In

ActiveSheet.UsedRange.SpecialCells(xlCellTypeConst ants,
xlTextValues)

Any ideas? I don't see it...
Thanks!
D

"Jim Rech" wrote in message
...
See if this is better:

Sub ConvertUsedRgToProperCase()
Dim Cell As Range
On Error GoTo EndThis
For Each Cell In

ActiveSheet.UsedRange.SpecialCells(xlCellTypeConst ants,
xlTextValues)
Cell.Value = StrConv(Cell.Value, vbProperCase)
Next
EndThis:
End Sub

--
Jim Rech
Excel MVP
"D" wrote in message

news:pJiSc.26663$Oi.7755@fed1read04...
| Hey guys-
| Got this code from the net, seems to work fine until now.

I'm getting an
| Error 6 Overflow problem. I don't understand VB much at

all, so can
someone
| point me along the way?
| Thanks
| D
|
| Sub Step4()
| ' ProperCase Macro
| Dim c As Range
| With ActiveSheet
| For Each c In .UsedRange
| c.Value = Application.WorksheetFunction.Proper(c.Value)
| Next
| End With
|
| End Sub
|
|








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
Overflow when translating from C++ HELP!! hunting Excel Programming 6 April 24th 04 08:18 PM
overflow error ExcelMonkey[_5_] Excel Programming 6 January 22nd 04 02:34 AM
Overflow in VBA, but value < limit Brad[_13_] Excel Programming 3 December 11th 03 04:16 AM
VBA overflow Tom Ogilvy Excel Programming 3 September 2nd 03 09:04 PM
VBA overflow Don Guillett[_4_] Excel Programming 2 September 2nd 03 04:19 PM


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

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

About Us

"It's about Microsoft Excel"