View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Lunch Lunch is offline
external usenet poster
 
Posts: 8
Default Edit String VB Macro

Norman,

Thanks for the quick reply! I'm still learning VB and such so I'm
trying to read the code, figure out what it's doing as well as learn
how this integrates with excel and it's quarks. Naturally I got
snagged on the simple part after you did everything
else..................... "Change" DOH!


'=============
Public Sub Tester001()
Dim rng As Range
Dim rCell As Range

Set rng = ("I1:AK1") '<<==== CHANGE

For Each rCell In rng.Cells
With rCell
On Error Resume Next
If Not IsEmpty(.Value) Then
.Value = Mid(.Value, 5) & Left(.Value, 1)
End If
On Error GoTo 0
End With
Next rCell
End Sub
'<<=============

Results in: Compile error: Type Mismatch - Same error occurs if I run
"I1:AK1" - Just I1:AK1 results in "Compile error: Sub or Function not
defined"


Just for kicks here is a partial list of some of the variables.

T | TI01 D | TI01 C | TI01 T | TI02 D | TI02 C | TI02 T | TI03 D |
TI03 C | TI03 T | TI04

If I'm reading the code right, and I'd like to think I am, after
pulling out the old VB book I think I see what it's doing. =)