View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default How to declare the active worksheet?

First activate the sheet you want:

Sheets("Sheet1").Activate
--
Gary''s Student - gsnu200753


"Mekinnik" wrote:

In the following lines of code how co uld I declare what the activesheet is
and make the line still work?

For dX = 1 To ActiveSheet.UsedRange.Rows.Count
If IsError(Application.Match(sSelected, ActiveSheet.Columns(1), 0)) Then