Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Working on unselected sheets

  1. #11
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    That is very hard to follow. There is rarely ever any need to select Objects to apply a Method or alter it's Properties. Just quickly it looks like your could be just:

    Sheets("Stock List").Range("E2") = Range("B2").Value
    Range("C2:D2").ClearContents
    Range("B3") = Range("E3").Value
    Range("C4:D4").ClearContents

  2. #12
    New Member
    Join Date
    Feb 2002
    Location
    England
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Sorry Dave i dont follow.

  3. #13
    Guest

    Default

    Try this :-

    Dim sh As Worksheet, rng As Range
    Set sh = ThisWorkbook.Sheets("Sheet1")
    With sh
    If .Range("E3") = "" Then
    Set rng = .Range("E2")
    Else
    Set rng = .Range(.Range("E2"), .Range("E2").End(xlDown))
    End If
    End With
    With rng
    .Offset(0, -3).Value = .Value
    .Offset(0, -2).Resize(, 2).ClearContents
    End With

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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