Home > Software engineering >  I changed the code seems to can't obtain the data
I changed the code seems to can't obtain the data

Time:09-20



CodePudding user response:

First saw this, but tried, also determine the feasible,
Your code with the worksheet named "regional" do not match, will be "cannot be read correctly,"

Why don't you into a more direct operation, such as:
 'to make the "current activity worksheet" A3 to the A50 48 data read into memory: 
Arr1=Range (" A3: A50 ")

In front of the Range () is not specified "which form", it is the current active working table;
If there is only one table, or you this when use won't switch to the other table, so it doesn't matter,
Otherwise, you must specify the name of the table ", "in order to avoid to read the wrong data,
Anyway, I write my own VBA code, are explicitly specified worksheet,

CodePudding user response:

All commented On the Error Resume Next statement, running in the VBA IDE,
The error and then click the debugging, the cursor will stop error in the statement,
Or
In doubt may have a logical error statements in advance to set breakpoints, run through the breakpoint interrupt,

At this point can be used in the immediate window
? The variable name
Or
? The function name () function parameter
Or
Process (parameters)
Auxiliary debugging,
  •  Tags:  
  • VBA
  • Related