Results 1 to 5 of 5

Offset Alters Entire Range, Need To Offset A Single Cell

Threaded View

  1. #1
    Forum Contributor
    Join Date
    10-29-2019
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    156

    Offset Alters Entire Range, Need To Offset A Single Cell

    Hi, Im trying to offset the range in ValuesRange = Range("A1:A4"), but I need to just offset cell A4, atm it offsets the entire range so it looks like : A2:A5 A3:A6 etc., I just need the A4 part offset, so it looks like A1:A5, A1:A6, A1:A7 etc.,

    Is there anyway to do this, without splitting the range into two variables?

    Thanks.


    Sub ValleyDips()
        Dim ValuesRange As Range
        Dim ResultCell As Range
        Dim CriteriaValue As Range
        Set ValuesRange = Range("A1:A4")
        Set ResultCell = Range("C3")
        Set CriteriaValue = Range("A1")
        HighestCurentValue = CriteriaValue
        For j = 1 To 4
            ResultCell = Application.WorksheetFunction.CountIf(ValuesRange, "<" & CriteriaValue)
            If ResultCell > 2 Then
                d = ValuesRange.Offset(i, 0).Address
                i = i + 1
                MsgBox d & HighestCurentValue
            End If
            If ResultCell < 2 Then
                d = CriteriaValue.Offset(i, 0).Address
                i = i + 1
                MsgBox d & HighestCurentValue
            End If
            
            'MsgBox d & HighestCurentValue
            
        Next j
    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. Replies: 6
    Last Post: 11-13-2018, 04:54 AM
  2. How to offset previously offset-ed cell ?
    By freshe in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-07-2015, 09:34 AM
  3. Replies: 3
    Last Post: 06-01-2014, 10:26 AM
  4. Offset function not capturing entire range
    By shawnvon in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-09-2014, 03:09 AM
  5. function similar to offset to offset the offset
    By Jerseynjphillypa in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-03-2012, 03:07 PM
  6. Reformatting - insert formula with offset, then offset to next cell
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-06-2011, 05:41 AM
  7. Replies: 7
    Last Post: 11-04-2008, 06:41 AM

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