Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I tried first searching on the discussion group already place questions but
could not find what I need. I have a variable I use to store a cell address xlast = ActiveCell.Address I am trying to declare it as public so I can use it in other modules but I have fail several ways... what I have is Global xlast As Range Is the Range type correct? or how should I do? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ActiveCell.Address is a string.
So: Public xlast As String If you used: Set xlast = ActiveCell Then Public xlast As Range would be correct "Alberto Ast" wrote in message ... I tried first searching on the discussion group already place questions but could not find what I need. I have a variable I use to store a cell address xlast = ActiveCell.Address I am trying to declare it as public so I can use it in other modules but I have fail several ways... what I have is Global xlast As Range Is the Range type correct? or how should I do? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks it works...
Have another question related for future reference... If I use string then I can use xlast = activecell.address range ("A1",xlast).select but if I use range I need to do set xlast = Activecell How do I get into this cell in the future? range("A1",xlaset).select will not work "JLGWhiz" wrote: ActiveCell.Address is a string. So: Public xlast As String If you used: Set xlast = ActiveCell Then Public xlast As Range would be correct "Alberto Ast" wrote in message ... I tried first searching on the discussion group already place questions but could not find what I need. I have a variable I use to store a cell address xlast = ActiveCell.Address I am trying to declare it as public so I can use it in other modules but I have fail several ways... what I have is Global xlast As Range Is the Range type correct? or how should I do? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
DIm xLast as string xlast = activecell.address range ("A1",Range(xlast)).select Or Dim xLast as Range set xlast =activecell range("A1", xlast).seleect Regards, Per On 19 Sep., 03:54, Alberto Ast wrote: Thanks it works... Have another question related for future reference... If I use string then I can use xlast = activecell.address range ("A1",xlast).select but if I use range I need to do set xlast = Activecell How do I get into this cell in the future? range("A1",xlaset).select will not work "JLGWhiz" wrote: ActiveCell.Address is a string. So: Public xlast As String If you used: Set xlast = ActiveCell Then Public xlast As Range would be correct "Alberto Ast" wrote in message ... I tried first searching on the discussion group already place questions but could not find what I need. I have a variable I use to store a cell address * *xlast = ActiveCell.Address I am trying to declare it as public so I can use it in other modules but I have fail several ways... what I have is * *Global xlast As Range Is the Range type correct? or how should I do?- Skjul tekst i anførselstegn - - Vis tekst i anførselstegn - |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
DIm xLast as string
xlast = activecell.address range ("A1",Range(xlast)).select Or Dim xLast as Range set xlast =activecell range("A1", xlast).select You can use same last line... Range("A1", xlast).Select for both of these approaches. -- Rick (MVP - Excel) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
public variable declaration, memory efficient? | Excel Programming | |||
Use of Public for data declaration in Excel 2000 | Excel Programming | |||
Declaration of public variable - Question | Excel Programming | |||
Public declaration | Excel Programming | |||
public declaration | Excel Programming |