Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
move column data based on value of another column [email protected] Excel Programming 0 January 8th 07 04:05 PM
how to move the cursor to column A after entering data column F tskaiser New Users to Excel 2 April 29th 06 02:28 PM
move contents of column C based on criteria related to column A Debra Excel Discussion (Misc queries) 2 December 27th 05 10:25 PM
move column headings from row to column EducatingMom Excel Worksheet Functions 1 June 3rd 05 05:06 PM
Move Cell in Column A to Column B when FIND juan Excel Programming 2 April 6th 04 10:20 PM


All times are GMT +1. The time now is 09:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"