Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to locate a cell with dynamic column value

Dear all,

I am writing a program which can select a cell with dynamic column value.

e.g. if the row is fixed to 4th row and the colum can be any value, I used
the following code:

ActiveSheet.Cells(4 & "," & tempCol).Select

If the value of tempCol is 3, it is supposed to select the cell at the 4th
row and 3rd column, but it ends up with selecting the cell at 1st row and
43th column

So anyone knows how to handle this? Thanks in advance.

Terence
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default How to locate a cell with dynamic column value

Try :
ActiveCell.EntireRow.Cells(4, tempCol).Select

"Terence C" wrote:

Dear all,

I am writing a program which can select a cell with dynamic column value.

e.g. if the row is fixed to 4th row and the colum can be any value, I used
the following code:

ActiveSheet.Cells(4 & "," & tempCol).Select

If the value of tempCol is 3, it is supposed to select the cell at the 4th
row and 3rd column, but it ends up with selecting the cell at 1st row and
43th column

So anyone knows how to handle this? Thanks in advance.

Terence

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default How to locate a cell with dynamic column value

Try
tempCol = 3
ActiveSheet.Cells(4, tempCol).Select

If this post helps click Yes
---------------
Jacob Skaria


"Terence C" wrote:

Dear all,

I am writing a program which can select a cell with dynamic column value.

e.g. if the row is fixed to 4th row and the colum can be any value, I used
the following code:

ActiveSheet.Cells(4 & "," & tempCol).Select

If the value of tempCol is 3, it is supposed to select the cell at the 4th
row and 3rd column, but it ends up with selecting the cell at 1st row and
43th column

So anyone knows how to handle this? Thanks in advance.

Terence

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
locate cell with specific text and select that column rockytopfan4ever Excel Discussion (Misc queries) 3 July 30th 08 01:53 PM
Locate last cell in column Sloth Excel Discussion (Misc queries) 8 January 24th 08 05:36 PM
Help with copying dynamic column selected based on remote cell value and dynamic formula fill ers Charts and Charting in Excel 0 March 1st 06 01:05 AM
Help with copying dynamic column selected based on remote cell value and dynamic formula fill ers Excel Programming 0 March 1st 06 01:05 AM
How to locate the Row and Column of an Active Cell Fred Excel Discussion (Misc queries) 1 December 7th 05 05:55 PM


All times are GMT +1. The time now is 02:14 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"