ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   find text in a sheet (https://www.excelbanter.com/excel-programming/325390-find-text-sheet.html)

bandy2000

find text in a sheet
 
How can I find a specific string in a worksheet and then select a specific
range of cells underneath this cell with the text entry and then calculate
something with the selected data?
Could somebody provide some sample code?
Thanks

gocush[_29_]

find text in a sheet
 
Option Explicit

Sub FindText()
Dim oCell As Range

For Each oCell In ActiveSheet.UsedRange
If oCell = "Some Text" Then
Range(oCell.Offset(1, 0), oCell.Offset(15, 4)).Select
'do something with this range
End If
Next oCell


End Sub

"bandy2000" wrote:

How can I find a specific string in a worksheet and then select a specific
range of cells underneath this cell with the text entry and then calculate
something with the selected data?
Could somebody provide some sample code?
Thanks



All times are GMT +1. The time now is 02:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com