ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cell Selection in Macro (https://www.excelbanter.com/excel-programming/415095-cell-selection-macro.html)

Nesara

Cell Selection in Macro
 
Hi all

i am having row number and column number (for example row = 4 and column =
20), pls tell me the method or syntax to select the cell (row = 4 and column
= 20)
I have used Range("row:col").select, but it is not working.

second one is how to store the Activecell content
I have used the follwing code for the same
Dim Ac1 As Application
Ac1.Activecell = Activecell.Offset(0,10).Range("A1")

But it is also not working
Pls help me

Gary''s Student

Cell Selection in Macro
 
Cells(4, 20).Select
--
Gary''s Student - gsnu200797

Mike H

Cell Selection in Macro
 
Try this

rRow = 4
rColumn = 20
Cells(rRow, rColumn).Select

or
Cells(4, 20).Select

I'm not entirely sure by what you mean for the second part of the question
but maybe this

myvalue = ActiveCell.Value
myvalue1 = ActiveCell.Offset(1, 2).Value

Mike

"Nesara" wrote:

Hi all

i am having row number and column number (for example row = 4 and column =
20), pls tell me the method or syntax to select the cell (row = 4 and column
= 20)
I have used Range("row:col").select, but it is not working.

second one is how to store the Activecell content
I have used the follwing code for the same
Dim Ac1 As Application
Ac1.Activecell = Activecell.Offset(0,10).Range("A1")

But it is also not working
Pls help me


Nesara

Cell Selection in Macro
 
Thank you .

"Gary''s Student" wrote:

Cells(4, 20).Select
--
Gary''s Student - gsnu200797


Nesara

Cell Selection in Macro
 
Thank you for the solution.

"Mike H" wrote:

Try this

rRow = 4
rColumn = 20
Cells(rRow, rColumn).Select

or
Cells(4, 20).Select

I'm not entirely sure by what you mean for the second part of the question
but maybe this

myvalue = ActiveCell.Value
myvalue1 = ActiveCell.Offset(1, 2).Value

Mike

"Nesara" wrote:

Hi all

i am having row number and column number (for example row = 4 and column =
20), pls tell me the method or syntax to select the cell (row = 4 and column
= 20)
I have used Range("row:col").select, but it is not working.

second one is how to store the Activecell content
I have used the follwing code for the same
Dim Ac1 As Application
Ac1.Activecell = Activecell.Offset(0,10).Range("A1")

But it is also not working
Pls help me



All times are GMT +1. The time now is 03:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com