View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
F[_2_] F[_2_] is offline
external usenet poster
 
Posts: 46
Default Button to copy row to first empty row on another sheet

On 04/05/2011 03:23 Rick Rothstein wrote:

Just out of interest, can anyone explain why I was
getting the error at 'Rows("nextrow:nextrow").Select'
in my original attempt?


I am guessing that nextrow is a variable name... you cannot put variable
names inside of quote marks... anything inside of quote marks are just
characters and have no meaning to VB beyond that. The correct syntax
would have been...

Rows(nextrow & ":" & nextrow).Select

However, the Rows property, unlike the Range property, does not need the
repeated same row number to work; this would have worked also...

Rows(nextrow).Select

Rick Rothstein (MVP - Excel)


Thanks: it works and I've learnt something new!

--
F