Results 1 to 7 of 7

Problem with setting range in Macro

Threaded View

floridagunner Problem with setting range in... 06-21-2012, 01:45 PM
Medpack Re: Problem with setting... 06-21-2012, 01:55 PM
floridagunner Re: Problem with setting... 06-21-2012, 02:34 PM
Medpack Re: Problem with setting... 06-21-2012, 06:22 PM
Medpack Re: Problem with setting... 06-21-2012, 06:25 PM
floridagunner Re: Problem with setting... 06-21-2012, 10:05 PM
protonLeah Re: Problem with setting... 06-21-2012, 06:48 PM
  1. #1
    Registered User
    Join Date
    07-13-2007
    Posts
    50

    Problem with setting range in Macro

    Hello,

    I have written the following macro that is not working as intended:

    Sub ConversionRange()
    
    Dim myRange As Range
    Dim cRange As Range
    
    Set myRange = Sheets("SAP Refined Data").Range("1:1")
    Set cRange = myRange.Find(What:="Cost Element").Offset(1, 0).Range(Selection, Selection.End(xlDown))
    
    myRange.Select
    
    End Sub
    When activated, what I need the macro to do is go the worksheet "SAP Refined Data" and select the data below the cost element heading. However whenever I activate the macro from another worksheet I get the "Run-time error '1004': Application-defined or object defined error" message.

    Can anyone point out what I might be doing wrong?

    Thanks
    floridagunner
    Last edited by floridagunner; 06-21-2012 at 01:52 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1