Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to move to column B1 from column Z1
Hi
my current cell is at column z1, i check for a condition, if true then i move to column b1 to get the data, if not true, i move to next row & then test again. how do i move to column b1 from column z1? Do i use the offset function ? Thank you for any suggestion provided. kiwis |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to move to column B1 from column Z1
Hi Kiwis,
'--------------- my current cell is at column z1, i check for a condition, if true then i move to column b1 to get the data, if not true, i move to next row & then test again. how do i move to column b1 from column z1? Do i use the offset function ? '--------------- It is usually neither necessary nor desirable to select cells, An appropriate code might be like: '============ Public Sub Tester() Dim WB As Workbook Dim SH As Worksheet Dim Rng As Range Dim Rng2 As Range Dim rCell As Range Const vVal = 5 Set WB = Workbooks("MyBook.xls") '<<=== CHANGE Set SH = WB.Sheets("Sheet1") '<<=== CHANGE Set Rng = SH.Range("Z1:Z100") '<<=== CHANGE For Each rCell In Rng.Cells With rCell If .Value vVal Then Set Rng2 = rCell.EntireRow.Cells(2) MsgBox Rng2.Value End If End With Next rCell End Sub '<<============ --- Regards, Norman |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
move column data based on value of another column | Excel Programming | |||
how to move the cursor to column A after entering data column F | New Users to Excel | |||
move contents of column C based on criteria related to column A | Excel Discussion (Misc queries) | |||
move column headings from row to column | Excel Worksheet Functions | |||
Move Cell in Column A to Column B when FIND | Excel Programming |