LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select method of range class failed


I keep getting this error
Run-time error '1004':
Select method of Range class failed

from this code at the first Range("I2").select statement. I dont see
what is wrong. Please help!!




Sub Import

Dim strname As String

strname = ActiveWorkbook.Name
Workbooks.Open "C:\Macro_Practice\Sep_download.xls"
' wkbBook = Workbooks("Sep_download.xls")

Workbooks("Sep_download.xls").Worksheets(1).Copy
befo=Workbooks(strname).Worksheets(3)
Workbooks("Sep_download.xls").Close savechanges:=True

Sheets("sheet2").Select
ActiveWindow.SelectedSheets.Delete

Sheets("sep_download").Select
Range("I2").Select
ActiveCell.FormulaR1C1 = "=Trim(RC[-8])"
Range("I2").Select
Call GetRealLastCell
Selection.AutoFill Destination:=Range(I2, RealLastRow)



End Sub

Sub GetRealLastCell()
Dim RealLastRow As Long
Dim RealLastColumn As Long
Range("A1").Select
On Error Resume Next
RealLastRow = _
Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row
RealLastColumn = _
Cells.Find("*", [A1], , , xlByColumns, xlPrevious).Column
Cells(RealLastRow, RealLastColumn).Select
End Sub


--
sa02000
------------------------------------------------------------------------
sa02000's Profile: http://www.excelforum.com/member.php...o&userid=27747
View this thread: http://www.excelforum.com/showthread...hreadid=473119

 
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 sa02000[_4_] Excel Programming 1 October 5th 05 01:20 PM
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


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

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

About Us

"It's about Microsoft Excel"