Error 28 - Excel vba macro

Joined
May 19, 2013
Messages
2
Reaction score
0
Hello

I have been using the following vba macro successfully on my old laptop, but since I updated my laptop I now get "Runtime error 28 - Stack out of space". The old laptop was running Office Professional 2007 with Windows Vista, the new laptop has the same Office suite running on Windows 8.1. My thoughts are that it must be something to do with the change to Windows 8.1
Heres the code:-

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim VRange As Range
Dim cell As Range

Set VRange = Range("InputRange")
For Each cell In Target
If Union(cell, VRange).Address = VRange.Address Then
If Len(cell) > 2 Then
cell.Value = StrConv(cell.Value, vbProperCase)
Else
cell.Value = StrConv(cell.Value, vbUpperCase)
End If
End If
Next cell
End Sub

Any assistance would be greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top