View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Gregg Roberts[_2_] Gregg Roberts[_2_] is offline
external usenet poster
 
Posts: 2
Default Excel ignores VBA commands

Hi Dianne,

Based on the help file, the SpecialCells method gives the
same result whether the object it is used on is Cells or
ActiveCell. I am using this exact same statement to get
the row number of the last row of data in the "data"
workbook, so I can test to see whether I have enough rows
left in the destination workbook to my pasting, and it
works consistently.

Also, the statements being ignored are only ignored after
they have been executed many times in a loop already. As I
wrote, even the statement

Range("A1").Select

is also being ignored. The range of cells selected in the
destination workbook/sheet stays selected after this
statement is "executed." This is the level of weirdness
that is happening.

While I waited for an answer from the NG I changed my
statement to:

Selection.End(xlDown).Offset(1, 0).Select

Again, the statement works for a while, and then stops
working for no apparent reason.

There are always eight columns in the copied range, hence
no reason to test for that.

Gregg