Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to set active cell range to an variable

Hi. I want to fetch the address of the active cell so that I can use the
reference to build a formula. I have tried some, but so far I only got the
value of the active cell, and that doesn't help me at all.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default How to set active cell range to an variable

I think ActiveCell.Address is what you are looking for.

Example:-
Dim strAddress as String

strAddress = ActiveCell.Address

Use Replace function if you want to remove $ signs.

Regards,

OssieMac

"Jørgen Andreassen" wrote:

Hi. I want to fetch the address of the active cell so that I can use the
reference to build a formula. I have tried some, but so far I only got the
value of the active cell, and that doesn't help me at all.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to set active cell range to an variable

Thanks mate, that did the trick. I declared the variable wrong... :|


OssieMac skrev:

I think ActiveCell.Address is what you are looking for.

Example:-
Dim strAddress as String

strAddress = ActiveCell.Address

Use Replace function if you want to remove $ signs.

Regards,

OssieMac

"Jørgen Andreassen" wrote:

Hi. I want to fetch the address of the active cell so that I can use the
reference to build a formula. I have tried some, but so far I only got the
value of the active cell, and that doesn't help me at all.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default How to set active cell range to an variable

'Depending on exactly what you are doing
'the following can also be used for the
'address of the active cell.

Dim rowNumber As Single
Dim colNumber As Single

rowNumber = ActiveCell.Row

colNumber = ActiveCell.Column

Cells(rowNumber, colNumber) = "This is active cell"

regards,

OssieMac

"OssieMac" wrote:

I think ActiveCell.Address is what you are looking for.

Example:-
Dim strAddress as String

strAddress = ActiveCell.Address

Use Replace function if you want to remove $ signs.

Regards,

OssieMac

"Jørgen Andreassen" wrote:

Hi. I want to fetch the address of the active cell so that I can use the
reference to build a formula. I have tried some, but so far I only got the
value of the active cell, and that doesn't help me at all.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default How to set active cell range to an variable

if you don't want the $'s, use this:


strAddress = ActiveCell.Address(0, 0)

--


Gary


"OssieMac" wrote in message
...
I think ActiveCell.Address is what you are looking for.

Example:-
Dim strAddress as String

strAddress = ActiveCell.Address

Use Replace function if you want to remove $ signs.

Regards,

OssieMac

"Jørgen Andreassen" wrote:

Hi. I want to fetch the address of the active cell so that I can use the
reference to build a formula. I have tried some, but so far I only got the
value of the active cell, and that doesn't help me at all.





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
Set a variable to the active cell Richard Excel Discussion (Misc queries) 1 March 24th 08 05:42 PM
Active cell as range Patrick Simonds Excel Programming 4 May 29th 06 08:21 PM
name variable with 3 first characters of active cell shark102 Excel Programming 6 October 22nd 05 02:32 AM
Excel VBA-use variable in active cell formula problem waveracerr Excel Programming 9 February 6th 04 02:49 PM
value of active cell into a variable TusaJii Excel Programming 1 January 24th 04 05:54 PM


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

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

About Us

"It's about Microsoft Excel"