Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refer to cell in diff sheet
I have the following below, and I want If (cell.value) = "1034" to
refer to cell G2 in worksheet entitled "menu." How would I write that, so it refers to the value in that cell. Thanks. Sub Delete_Rows() ' This macro deletes all rows on the active worksheet ' that have 1034, 1035, 1037 column E. Dim rng As Range, cell As Range, del As Range Set rng = Intersect(Range("E:E"), ActiveSheet.UsedRange) For Each cell In rng If (cell.Value) = "1034" _ Or (cell.Value) = "1035" _ Or (cell.Value) = "1037" Then If del Is Nothing Then Set del = cell Else: Set del = Union(del, cell) End If End If Next On Error Resume Next del.EntireRow.Delete End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I copying data from a cell on sheet to a diff cell/sheet | Excel Worksheet Functions | |||
Refer to a sheet using a cell value | Excel Worksheet Functions | |||
refer to a cell in another sheet | Excel Programming | |||
Excel VBA (?!)-refer to a cell on Sheet to left of X, based on criteria on Sheet X | Excel Programming | |||
Refer to a sheet in a cell | Excel Programming |