LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Getting a Select Range class field during a macro setup

Avoid selecting the range and all will be well. In order to select a range on
a specific sheet you first have to select the sheet (which you probably have
not done). Try this

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

Since there is no selecting there should be no problem.
--
HTH...

Jim Thomlinson


"ssciarrino" wrote:

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select method of Range class failed - but why??? Orion[_2_] Excel Programming 3 December 21st 04 03:28 PM
select method of range class failed Joseph[_40_] Excel Programming 0 September 28th 04 04:08 PM
select method of range class failed Joseph[_38_] Excel Programming 1 September 28th 04 03:21 PM
select method of range class failed Joseph[_39_] Excel Programming 0 September 28th 04 02:32 PM
Select method of Range class failure Stuart[_5_] Excel Programming 3 February 24th 04 06:35 PM


All times are GMT +1. The time now is 10:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"