VBA - Using defined range

Baxy 21 Reputation points
2022-08-23T20:04:43.2+00:00

I am trying to find why my macro won't work. I want cells to be cleared for a set number of tabs within the workbook based on a user-inputted range, but I can't seem to get it to work. Can someone please point out where I'm going wrong here?

Thanks,
Mike

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,583 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Olaf Helper 41,411 Reputation points
    2022-08-26T12:38:17.363+00:00

    How can one enter a Range object through a simple text InputBox? It's simply not possible and fails, but because of the "On Error Resume Next" you don't get it. That don't work
    Test:

    Option Explicit  
      
    Public Sub Test()  
        Dim rng As Range  
          
        Set rng = Application.InputBox("Test", "Test")  
        Debug.Print rng  
    End Sub  
    

    235273-image.png