Runtime Error 1004 Method of Range of Object_Global_Failed :: MrExcel Message Board


 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

Runtime Error 1004 Method of Range of Object_Global_Failed
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

JRSqualid
Board Regular


Joined: 03 Sep 2003
Posts: 30
Location: London
Flag: Blank

Status: Offline

 Reply with quote  

Runtime Error 1004 Method of Range of Object_Global_Failed

Hi Im new to Macros and VBA so this may be obvious

I have just edited a recorded macro that copies various ranges of cells from on sheet to another (pasting them into different cells according to the resuld of a Vlookup) IT workef fine before but when a changed the range i got the error in the title.

HEres the code

code:

Sub Macroupdatedependencyrecord()
    'This Macro updates the dependecies from the dependency file in the directory
    'Written by Jon Waller on 15/9/03
   
    Range("d2").Select
    Selection.Copy
    Sheets("filler").Select
    Range("E6").Select
    ActiveSheet.Paste
    Range("C6:d6").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Summary").Select
    Range("indirect(f2)").Select
    Selection.PasteSpecial Paste:=xlPasteValues, operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Sheets("Filler").Select
    ActiveSheet.Range("f6:n6").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Summary").Select
    Range("indirect(g2)").Select
    Selection.PasteSpecial Paste:=xlPasteValues, operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    End Sub




The old code just missed out cell m6 so the orginal second qouted range was (F6:l6) the the select copy paste bit repeated for cell n6.
At first after i made the change nothing was being paste to M6 on the summary sheet but was all the other cells in the range. I rebooted the machine and I get the error also if I hit debug I get an exception violation and excel crashes.

Thanks

Squal

Post Fri Sep 19, 2003 3:34 pm 
 View user's profile Send private message

Juan Pablo González
MrExcel MVP


Joined: 09 Feb 2002
Posts: 8580
Location: Marion, IL
Flag: Colombia

Status: Offline

 Reply with quote  

Re: Runtime Error 1004 Method of Range of Object_Global_Fail

What's this supposed to do ?

Range("indirect(f2)").Select

?
_________________
Regards,

Juan Pablo González
MrExcel.com Consulting

Read the Articles List and check out our Recommended links and Add-Ins

Post Fri Sep 19, 2003 3:37 pm 
 View user's profile Send private message Visit poster's website

JRSqualid
Board Regular


Joined: 03 Sep 2003
Posts: 30
Location: London
Flag: Blank

Status: Offline

 Reply with quote  

Re: Runtime Error 1004 Method of Range of Object_Global_Fail

Thanks Juan

I need to copy the results from one line on the filler sheet to varialble lines one the Summary sheet . THe cell address that I need the start the range that i paste cell f2 and is the result of a vlookup. It did seem to work fine befor I made amendments and works on another woorkbook it is used in.

Cheers

Squal

Post Fri Sep 19, 2003 3:50 pm 
 View user's profile Send private message

Juan Pablo González
MrExcel MVP


Joined: 09 Feb 2002
Posts: 8580
Location: Marion, IL
Flag: Colombia

Status: Offline

 Reply with quote  

Re: Runtime Error 1004 Method of Range of Object_Global_Fail

Try replacing that line with

Range(Range("F2").Value).Select
_________________
Regards,

Juan Pablo González
MrExcel.com Consulting

Read the Articles List and check out our Recommended links and Add-Ins

Post Fri Sep 19, 2003 3:58 pm 
 View user's profile Send private message Visit poster's website

JRSqualid
Board Regular


Joined: 03 Sep 2003
Posts: 30
Location: London
Flag: Blank

Status: Offline

 Reply with quote  

Re: Runtime Error 1004 Method of Range of Object_Global_Fail

No that didnt seem to work
If tried it twice the first time i got a small brown circle in the margin of the explore window with the code Range("f6:n6").Select High lighted in brown to.
Trying to find out what that means in my book

Post Fri Sep 19, 2003 4:12 pm 
 View user's profile Send private message
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.