Ask Question Forum:
C
O
M
P
U
T
E
R
2
8
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Y-position of the mouse cursor
Attachment:===
Range in VBA with run-time error

When I use range with cells syntax, it always occassionlly generate run-time
error but sometimes it is no problem and passed the VBA complier like the following
example,maxv = WorksheetFunction.Max(Range(Cells(firstrow, 29), Cells(lastrow, 29)))
Runtime is 400. When I change it to
maxv = WorksheetFunction.Max(Range(range("AB"& firstrow), range("AB"& lastrow))) that
is more stable and never report any error.
The question is the Range usage could not allow cells usage together or have some
condition like run in Sheet's sub instead of in Macro that is okay ?
The Range bug is hidden and sometimes has came out sometimes is not, Please advise
Duncan
Roya, it is realy clear enough and I always experience such issue about putting the code
in Sheet or Macro, so wahtever before any coding I will select the sheet I want first
such as worksheets("Intra").select, so other code like range will refer to "intra" sheet
Thanks for your detail
Roya, it is realy clear enough and I always experience such issue about putting the code
in Sheet or Macro, so wahtever before any coding I will select the sheet I want first
such as worksheets("Intra").select, so other code like range will refer to "intra" sheet
Thanks for your detail
Roya, it is realy clear enough and I always experience such issue about putting the code
in Sheet or Macro, so wahtever before any coding I will select the sheet I want first
such as worksheets("Intra").select, so other code like range will refer to "intra" sheet
Thanks for your detail
Roya, it is realy clear enough and I always experience such issue about putting the code
in Sheet or Macro, so wahtever before any coding I will select the sheet I want first
such as worksheets("Intra").select, so other code like range will refer to "intra" sheet
Thanks for your detail
Roya, it is realy clear enough and I always experience such issue about putting the code
in Sheet or Macro, so wahtever before any coding I will select the sheet I want first
such as worksheets("Intra").select, so other code like range will refer to "intra" sheet
Thanks for your detail
Roya, it is realy clear enough and I always experience such issue about putting the code
in Sheet or Macro, so wahtever before any coding I will select the sheet I want first
such as worksheets("Intra").select, so other code like range will refer to "intra" sheet
Thanks for your detail
Roya, it is realy clear enough and I always experience such issue about putting the code
in Sheet or Macro, so wahtever before any coding I will select the sheet I want first
such as worksheets("Intra").select, so other code like range will refer to "intra" sheet
Thanks for your detail
Roya, it is realy clear enough and I always experience such issue about putting the code
in Sheet or Macro, so wahtever before any coding I will select the sheet I want first
such as worksheets("Intra").select, so other code like range will refer to "intra" sheet
Thanks for your detail
Roya, it is realy clear enough and I always experience such issue about putting the code
in Sheet or Macro, so wahtever before any coding I will select the sheet I want first
such as worksheets("Intra").select, so other code like range will refer to "intra" sheet
Thanks for your detail
Roya, it is realy clear enough and I always experience such issue about putting the code
in Sheet or Macro, so wahtever before any coding I will select the sheet I want first
such as worksheets("Intra").select, so other code like range will refer to "intra" sheet
Thanks for your detail
Roya, it is realy clear enough and I always experience such issue about putting the code
in Sheet or Macro, so wahtever before any coding I will select the sheet I want first
such as worksheets("Intra").select, so other code like range will refer to "intra" sheet
Thanks for your detail
Roya, it is realy clear enough and I always experience such issue about putting the code
in Sheet or Macro, so wahtever before any coding I will select the sheet I want first
such as worksheets("Intra").select, so other code like range will refer to "intra" sheet
Thanks for your detail