Using a function in a macros to enter data in a specified cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have identified a cell address using the "address" function. I would like
to use the identified address to enter data into a cell using a macros. Would
someone please help?
 
If you have the address of a cell in a variable, say sAddr, you
can use this variable with the Range property to access that
cell. For example,


Dim sAddr As String
sAddr = "A1"
Range(sAddr).Value = 123


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




message
news:[email protected]...
 
If I understand your question, then it is very straight forward. Th
example below takes the values in cells D1 through D5, adds them up an
puts the result in the cell where you grabbed the address (in this cas
cell A1).

MyAddress = Range("A1").Address

Application.Sheets("Sheet1").Range(MyAddress).Formula = "=sum(D1:D5)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top