View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ssciarrino ssciarrino is offline
external usenet poster
 
Posts: 20
Default Getting a Select Range class field during a macro setup

I am a very newbie to Visual Basic. What I am trying to do is automate a
journal file conversion process via Excel worksheets.

I want on Sheet2 to remove column T when column T equals 01/01/1900, but
before we add the if statement I simply want to just delete the column. The
macro works well if I am on sheet2

Columns("T:T").Select
Selection.Delete Shift:=xlToLeft

But if I do this

Sheet2.Columns("T:T").Select
Selection.Delete Shift:=xlToLeft

Then I get this error

Run-time error 1004
Select method of Range class failed

This is so stupid simple I am missing something...now I realize I do not
have the 'If column T = 1/1/1900. I am just trying to delete the column
regardless of the condition from another sheet in the workbook.

thanks