Results 1 to 20 of 33

Thread: Use Offset to select offset cell value

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Dec 2008
    Posts
    85
    Location

    Use Offset to select offset cell value

    Wish to use Offset VBA to select cell value in VBA macro below, if possible. Please.

    Sub Rep()
    Dim c As Range
    For Each c In Range("d12:A" & Range("A" & Rows.Count).End(xlUp).Row)
    If c.Value = "1" Then c.Offset(, 1).Value = 1
    If c.Value = "2" Then c.Offset(, 1).Value = 2
    If c.Value = "4" Then c.Offset(, 1).Value = 4
    If c.Value = "5" Then c.Offset(c, 2).Select ‘Wrong
    If c.Value = "6" Then c.Offset(, 1).Value = 6
    Next c

    End Sub
    Column D Column E Column F
    ClockOut24 hr time
    Call Day
    1:BU 2:NE 4:WBU 5:WBU 6:KW
    Base Points
    1=1, 2=2, 4=4, 5= Weekend/Holiday Total Hrs @1.5, 6=6
    TotalPoints*
    Row 12
    4
    4
    Row 12
    5
    Valuecolumn F =57
    57

    If c.Value = "4" Then c.Offset(, 1).Value = 4 ‘working
    If c.Value = "5" Then c.Offset(, 2).Select ‘???? wish to select value of c.Offset(,2) which is 57

    Thanks.
    Last edited by Victor; 12-02-2021 at 12:00 PM.

Posting Permissions

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