Results 1 to 4 of 4

Code that grabs a dynamic range from a cell

Threaded View

  1. #1
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Code that grabs a dynamic range from a cell

    Hello,

    I have a file of data with sales information. A test is run over the data. Adjacent to the test I have an Address formula that gives me a result of a tab name and a range. It does this on any row that fails the test. This range in column DL is telling me where I need to go in the data and cut that range out of the data. The range in DK is telling me where I need to paste that cut data too. I need code that will loop through and skip over the blanks (data that passed the test) and perform the action of cut and paste on the ranges specified in each row of data that failed the test. I am having a hard time getting the code to use the value in the cell as the range. Any help would be appreciated.

    this code below goes through and cuts the data in cell DL and pastes it to DK. That isn't exactly how I want this to work. I want it to use the range in the cell as the location to go cut and use the range in the adjacent cell as the range to go paste to.

    Sub amarting575aazz()
    Dim rcell As Range
    For Each rcell In Range("DL9:DL" & ActiveSheet.UsedRange.Rows.Count + 1)
        If rcell.Value <> "" Then rcell.Value.Cut rcell.Value.Offset(, -1)
    Next rcell
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA code for Dynamic range
    By Srikanth H N in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-03-2014, 11:22 PM
  2. [SOLVED] Need help with Dynamic Range in my code.
    By moonsaga in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2014, 01:08 PM
  3. How can I fix the below code for establishing a dynamic range?
    By xcelnovice101 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2013, 03:16 PM
  4. How do i reference a dynamic cell range in VBA code
    By alice03 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-08-2013, 10:56 AM
  5. VBA code for dynamic name range
    By weii in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-12-2007, 07:36 PM

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