Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Pamela Baker   on Mar 20 In MS Office Category.

  
Question Answered By: Xander Thompson   on Mar 20

The problem  arises because of this line:
Dim shtFrom, shtTo, shtStart As Worksheet
which declares ONLY shtStart as a worksheet. You need to declare type
individually:
Dim shtFrom as Worksheet, shtTo as Worksheet, shtStart as worksheet

In the populate macro you will also get a type  mismatch in the line:
Set shtFrom = Sheets(z)
which should probably read:
Set shtFrom = z
since you've already defined z as a worksheet.

Finally, although you'll probably get away with it, I'd steer away
from using the same object name (shtFrom) in the two macros.

Share: 

 
 


Tagged: