Home > Forum Home > Excel Multiple Regression Analysis and Forecasting Template > Run-Time Error '13' Type Mismatch > Run-Time Error '13' Type Mismatch" Share

Run-Time Error '13' Type Mismatch"

Excel Help for Run-time Error '13' Type Mismatch" in Excel Multiple Regression Analysis and Forecasting Template


Forum TopicLogin

Run-time Error '13' Type Mismatch"

Rate this:
(3/5 from 1 vote)
ConfusedI am also getting a Run-Time Error '13' Type Mismatch in my code. I wrote a code that swops a name into reverse Like accounts to untsacco. When do for one cell the code works perfectly but I need to select a range from A1:A200.

When I do that thats when i get the mismatch Error, Please assist, here is my code

Sub Macro1()
Dim strPassword, Part1, Part2, Part3 As String
Dim xPos As String
Dim xLen As Integer

'
Range("A1").Select

strPassword = Range("A1").Value

xLen = Len(strPassword)

xPos = xLen / 2

If xLen Mod 2 <> 1 Then
Part1 = Mid(strPassword, xPos + 1, xPos)
Part2 = ""
Part3 = Mid(strPassword, 1, xPos)
Else
Part1 = Mid(strPassword, xPos + 2, xPos)
Part2 = Mid(strPassword, xPos + 1, 1)
Part3 = Mid(strPassword, 1, xPos)
End If

outstring = Part1 + Part2 + Part3

Range("D1") = outstring



End Sub
 
 Posted by on
 
View Full Post

Find relevant Excel templates and add-ins for Run-Time Error '13' Type Mismatch" in the