Skip to main content

How to find text in a worksheet and saving the row & column number where it is first found - Excel VBA

 
How to find text in a worksheet and saving the row & column number where it is first found - Excel VBA

 
Sub Find_Text_Get_ROWS_COlumns()
    
    Dim sText As String
    Dim FindRow As Range
    With ThisWorkbook.Sheets("Data")
        sText = "Hello"
        Set FindRow = .UsedRange.Find(What:=sText, LookIn:=xlValues)
        MsgBox FindRow.Row
        MsgBox FindRow.Column
    End With
End Sub

Comments

Popular posts from this blog

Python PyQt5

Install below packages - for windows  pip install PyQt5 pip install PyQt5-tools pip install pyqt5-installer Download PyQt5 Designer from the below link https://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.6/PyQt5-5.6-gpl-Py3.5-Qt5.6.0-x32-2.exe/download

Python - PyQt5 set Background image

import sys from PyQt5.QtCore import QSize from PyQt5.QtGui import QImage, QPalette, QBrush from PyQt5.QtWidgets import * class MainWindow ( QWidget ): def __init__ ( self ): QWidget. __init__ ( self ) self .setGeometry( 100 , 100 , 300 , 200 ) oImage = QImage( "test.jpg" ) sImage = oImage.scaled(QSize( 300 , 200 )) # resize Image to widgets size palette = QPalette() palette.setBrush( 10 , QBrush(sImage)) # 10 = Windowrole self .setPalette(palette) self .show() if __name__ == "__main__" : app = QApplication(sys.argv) oMainwindow = MainWindow() sys.exit(app.exec_())