Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default copy text from a cell to enter in macro

having not found an adequate solution to
http://www.OfficeKB.com/Uwe/Threads/...GP05.phx .gbl



i am now asking if i can take the text/values from a cell and use them in the
macro?

for example i have in cell D4 the text/value "A4"

can a macro take the text from this cell?

i plan to make the cell A4 an activecell, for reasons i wont go into now i
cant simply range("a4").select and apply the macro from there, is this
possible?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default copy text from a cell to enter in macro

If D1 contains A4 and you want the contents of A4, just nest the Range
property calls...

With Worksheets("Sheet2")
MsgBox .Range(.Range("D4").Value).Value
End With

Note that you do not have to select either D4 or A4 (the cell it is
referencing) in order to do what you want. If, however, you wanted to
ultimately select A4 (the value in D4), you would just change the last Value
property call to a Select method call instead...

With Worksheets("Sheet2")
.Range(.Range("A1").Value).Select
End With

--
Rick (MVP - Excel)


"Peterzh193" <u52491@uwe wrote in message news:9765201eb2634@uwe...
having not found an adequate solution to
http://www.OfficeKB.com/Uwe/Threads/...GP05.phx .gbl



i am now asking if i can take the text/values from a cell and use them in
the
macro?

for example i have in cell D4 the text/value "A4"

can a macro take the text from this cell?

i plan to make the cell A4 an activecell, for reasons i wont go into now i
cant simply range("a4").select and apply the macro from there, is this
possible?


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
Macro to search a text in a cell and copy the row to another set of cell rethish Excel Programming 1 February 10th 12 01:04 PM
copy text from a cell to enter in macro Patrick Molloy Excel Programming 0 June 10th 09 03:45 PM
Enter date in text box - copy to worksheet cell Francis Brown Excel Programming 2 October 20th 05 02:40 PM
Use Macro to copy part of text in cell PhilipsBernard Excel Programming 2 October 17th 05 09:09 AM
Macro to copy text upon entry into cell RAP Excel Programming 1 August 12th 05 08:49 AM


All times are GMT +1. The time now is 07:54 PM.

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"