View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Zack Barresse[_3_] Zack Barresse[_3_] is offline
external usenet poster
 
Posts: 101
Default referencing cell address

Hi there,

Change this ...

Cells(rng).

... to this ..

rng.

As you set 'rng' as a range object, you use it as such. The way you have it
you're trying to pass 'rng' as an argument property instead of an object.

HTH

--
Regards,
Zack Barresse, aka firefytr
To email, remove NOSPAM


"cereldine" wrote
in message ...

Could somene point me in the right direction with the below code, this
particular code is going to be part of a larger procedure but i would
like to understand this first.

The problem i'm having is i don't know syntax to reference a cell
address,
meaning that the range variable gets set to the text value of A1
instead of A1 itself, this messes up the rest of the statement. The bit
i would like some help on is in green
thanks

Public Sub export()
Dim rng As Range
Dim temprng As Range
Dim rngName As String

Range("A1").Select

Set rng = ActiveCell
do
rngName = rng.Text


MsgBox "Filepath " & rngText

temprng = Cells(rng).Offset(1, 0).Row
rng = temprng
Loop Until rngName = ""

End Sub


--
cereldine
------------------------------------------------------------------------
cereldine's Profile:
http://www.excelforum.com/member.php...o&userid=32069
View this thread: http://www.excelforum.com/showthread...hreadid=528155