ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Way to store cell location to variable? (https://www.excelbanter.com/excel-programming/367033-way-store-cell-location-variable.html)

farful[_3_]

Way to store cell location to variable?
 

I was wondering if there was a way to store a cell's location t
variables.

Something like:

Code
-------------------

int a, b
Cell(a, b) = ActiveCel
-------------------


I'm currently working with a fairly large worksheet, and I'm usin
Cells.Find to look for a specific cell. Then I want to Filter tha
column, but I can't figure out what column Selection.AutoFilte
Field:=?? should be.

Any suggestions

--
farfu
-----------------------------------------------------------------------
farful's Profile: http://www.excelforum.com/member.php...fo&userid=3617
View this thread: http://www.excelforum.com/showthread.php?threadid=56089


Nick Hodge

Way to store cell location to variable?
 
Farful

Here are a few ways

Sub AssignToVariables()
Dim sAddress
Dim lRow As Long
Dim iColumn As Integer
With ActiveCell
sAddress = .Address
lRow = .Row
iColumn = .Column
End With
MsgBox "Active cell address is " & sAddress & Chr(13) & _
"Row is, " & lRow & ". Column is, " & iColumn & "." & Chr(13) & _
"Therefore I can also reference it: Cells(" & lRow & " , " & iColumn &
")"
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


"farful" wrote in
message ...

I was wondering if there was a way to store a cell's location to
variables.

Something like:

Code:
--------------------

int a, b
Cell(a, b) = ActiveCell
--------------------


I'm currently working with a fairly large worksheet, and I'm using
Cells.Find to look for a specific cell. Then I want to Filter that
column, but I can't figure out what column Selection.AutoFilter
Field:=?? should be.

Any suggestions?


--
farful
------------------------------------------------------------------------
farful's Profile:
http://www.excelforum.com/member.php...o&userid=36172
View this thread: http://www.excelforum.com/showthread...hreadid=560892




Don Guillett

Way to store cell location to variable?
 
close
a=1
b=2
Cells(a, b).value = ActiveCell
----------------

--
Don Guillett
SalesAid Software

"farful" wrote in
message ...

I was wondering if there was a way to store a cell's location to
variables.

Something like:

Code:
--------------------

int a, b
Cell(a, b) = ActiveCell
--------------------


I'm currently working with a fairly large worksheet, and I'm using
Cells.Find to look for a specific cell. Then I want to Filter that
column, but I can't figure out what column Selection.AutoFilter
Field:=?? should be.

Any suggestions?


--
farful
------------------------------------------------------------------------
farful's Profile:
http://www.excelforum.com/member.php...o&userid=36172
View this thread: http://www.excelforum.com/showthread...hreadid=560892





All times are GMT +1. The time now is 08:19 AM.

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