View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
y y is offline
external usenet poster
 
Posts: 60
Default Macro stops before beginning.



Frank Kabel wrote:

Hi
just some first notes without testing the functionality:
1. Add the line
Option Explicit
at the beginning of your module. You have some variables which are not
defined (e.g. 'c' and sYValues)

2. The first varriable declaration 'Dim sArea, sXValues As Range' only
defines the second variable as range. The first 'sArea' is defined as
variant. You may use 'Dim sArea as range, sXValues As Range'

3. The line
.Sheets("Foglio1").Activate
is not allowed within this 'with' statement. You probably meant
Sheets("Foglio1").Activate
Additonal note: There's probably no need to activate the sheet. Just
set an object reference to this sheet and use this reference


Thanks Frank, I activate the sheet to compare the msg in msgbox with the data spread in the sheet.

Thanks, Alex.