![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#3
|
|||
|
|||
|
Than you p45cal for your posting. Somehow I managed to change the "For Each ws In ThisWorkbook.Sheets (old line) to "For Each ws In ActiveWorkbook.Worksheets" and it is working.
Code:
Sub testing()
Dim ws As Worksheet, fndRng As Range
For Each ws In ActiveWorkbook.Worksheets
'For Each ws In ThisWorkbook.Sheets (old line)
With ws.Range("Y:Y")
Set fndRng = .Find(What:="G", LookIn:=xlValues, LookAt:=xlWhole, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=True)
If Not fndRng Is Nothing Then
fndRng.Offset(-1).Resize(, 2).Value = fndRng.Resize(, 2).Value
fndRng.EntireRow.Delete
End If
End With
Next ws
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sharing a Workbook that contains array formula link to other workbook | Ahmad.rage22@gmail.com | Excel | 0 | 03-12-2018 10:15 PM |
| data entered in one workbook should be updated in other relevant workbook based on the date | vedha | Excel | 0 | 04-24-2015 08:45 PM |
| How to add attached excel workbook with hyperlink in the same workbook | lynchbro | Excel Programming | 0 | 02-24-2015 01:29 PM |
| Range(Cell1,Cell2) Error on another workbook controlling some other workbook? | tinfanide | Excel Programming | 1 | 02-09-2012 04:08 PM |
macro to transfer data from one workbook to another workbook
|
virsojour | Excel Programming | 5 | 02-01-2011 08:58 PM |