Results 1 to 6 of 6

How to select general (unspecified) range that is active ?

Threaded View

  1. #1
    Registered User
    Join Date
    02-07-2013
    Location
    Slovakia
    MS-Off Ver
    Excel 2010
    Posts
    31

    How to select general (unspecified) range that is active ?

    Hello to everyone, how are you today ? I am little bit sad (or mad) because I am stuck at relatively easy task (but not for me now as I discovered) and cant find nothing useful on net , so please help:D

    I have this macro for searching text in whole column and then add answer to next column - row. The problem is that the search range is only for specific column (now only for C1 to its end), but I want to search the text for any active column that I will select. So I need to know how to define, that the range will be dynamic or general for all columns that I select to search in, not only column C or some other. Hope I explain it clear.

    Sub FindWord()
    
    'ZADANIE DO SESDRU
    
        Dim FindString As String
        Dim FindCell As Range
         
        FindString = "Need to be added to SESDR"
        myreplace = "Add to SESDR"
        If FindString = "" Then Exit Sub
         
       For Each FindCell In Range(ActiveSheet.Range("C1"), ActiveSheet.Range("C65536").End(xlUp)).Cells
            If InStr(FindCell, FindString) > 0 Then FindCell.Offset(, 1) = myreplace
        Next FindCell
    Last edited by arlu1201; 02-08-2013 at 08:49 AM. Reason: Use code tags in future

Thread Information

Users Browsing this Thread

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

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