Thread: Delete a Row
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default Delete a Row

Tom,
Yet another lesson! My workbook had not been saved and hence my
result. So much to remember - my age is definitely working against me.

Thanks again.

"Tom Ogilvy" wrote:

It would depend on whether the workbook was named Book2 (an unsaved
workbook) or Book2.xls. I suspect Norman was either using a saved workbook
or emphasizing the valuable lesson that if a workbook has been saved, then
it should be addressed in the workbooks collection with the extension
included.

On computers with the Windows setting of Hide Known extensions, then
Workbook("Book2") could be used to refer to Book2.xls.

--
Regards,
Tom Ogilvy

"Toppers" wrote in message
...
Hi,
In XL2003 only works if TestBookName="Book2" not "Book2.xls" (or

at
least on my m/c!)

"Norman Jones" wrote:

Hi Ken,

Your syntax works for me.

I tested using:

'=============
Public Sub Tester()
Const TestBookName As String = "Book2.xls"
Const RowNumber As Long = 2

Workbooks(TestBookName).Sheets(1).Rows(RowNumber). Delete

End Sub
'<<=============


---
Regards,
Norman



"Ken Hudson" wrote in message
...
I want to delete a row in a different, open workbook, but can't get the
syntax right.

Workbooks(TestBookName).Sheets(1).Rows(RowNumber). Delete

doesn't work.
--
Ken Hudson