Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've got Type Mismatch error message while I'm running the following code
(It happens half way through, so I think the code can work ok, but I don't know why it stops right in the middle!!!! How can I improve the code and solve the problem? Pls Help!!! Thanks!!! Function Copy(ByVal RowNum As String Sheets("Region").Selec C1 = For S2 = 2 To 5000 If Workbooks("Test.xls").Worksheets("Region").Cells(S 2, 1) = "" Then Exit For If Right(Workbooks("Test.xls").Worksheets("Region").C ells(S2, 3), 3) _ <----- It stop right here = Workbooks("Test.xls").Worksheets("Macro").Cells(Ro wNum, 4) And Right(Workbooks("Test.xls").Worksheets("Region").C ells(S2, 3), 3) < "South" The For S3 = 1 To 3 Worksheets("Region").Cells(C1, S3) = Workbooks("Test.xls").Worksheets("Region").Cells(S 2, S3 Next S C1 = C1 + ElseIf Left(Workbooks("Test.xls").Worksheets("Region").Ce lls(S2, 3), 4) = Workbooks("Test.xls").Worksheets("Macro").Cells(Ro wNum, 5) The For S3 = 1 To 3 Worksheets("Region").Cells(C1, S3) = Workbooks("Test.xls").Worksheets("Region").Cells(S 2, S3 Next S C1 = C1 + End I Next S End Functio |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Type Mismatch Error | Excel Discussion (Misc queries) | |||
Type mismatch... | Excel Discussion (Misc queries) | |||
Type Mismatch | Excel Worksheet Functions | |||
type mismatch--how to fix | Excel Discussion (Misc queries) |