#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro ?


Hello all, I need some assistance please....I have a macro that i
putting a reference into a particular cell...the reference depends o
the cell that certain information is placed in, so it can differ ever
time the macro is run. Now, I need a way to take that cell and brea
it up into the letter and number. ie. Range("A3").value = "G33"...
have another macro that is going to use the value "G33", but I need i
to break it apart into the letter "G" and the number "33"...is thi
possible?? Any help provided will be greatly appreciated

--
dok11
-----------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php...fo&userid=1058
View this thread: http://www.excelforum.com/showthread.php?threadid=38038

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Macro ?

You can use a formula. If it is always letter number, then use

=LEFT(A1,1)

and

=RIGHT(A1,LEN(A1)-1)

If it is more complex, you can us

=LEFT(A1,MAX(ISNUMBER((MID(A1,ROW($1:$100),1)*1))* ROW($1:$100))+1)

and

=MID(A1,MAX(ISNUMBER((MID(A1,ROW($1:$100),1)*1))*R OW($1:$100))+2,99)


--

HTH

RP
(remove nothere from the email address if mailing direct)


"dok112" wrote in
message ...

Hello all, I need some assistance please....I have a macro that is
putting a reference into a particular cell...the reference depends on
the cell that certain information is placed in, so it can differ every
time the macro is run. Now, I need a way to take that cell and break
it up into the letter and number. ie. Range("A3").value = "G33"...I
have another macro that is going to use the value "G33", but I need it
to break it apart into the letter "G" and the number "33"...is this
possible?? Any help provided will be greatly appreciated!


--
dok112
------------------------------------------------------------------------
dok112's Profile:

http://www.excelforum.com/member.php...o&userid=10581
View this thread: http://www.excelforum.com/showthread...hreadid=380380



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Macro ?

Hi

Is the letter always one character ?

Dim str As String
str = "G33"
MsgBox Mid(str, 1, 1)
MsgBox Mid(str, 2, 100)


--
Regards Ron de Bruin
http://www.rondebruin.nl


"dok112" wrote in message
...

Hello all, I need some assistance please....I have a macro that is
putting a reference into a particular cell...the reference depends on
the cell that certain information is placed in, so it can differ every
time the macro is run. Now, I need a way to take that cell and break
it up into the letter and number. ie. Range("A3").value = "G33"...I
have another macro that is going to use the value "G33", but I need it
to break it apart into the letter "G" and the number "33"...is this
possible?? Any help provided will be greatly appreciated!


--
dok112
------------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php...o&userid=10581
View this thread: http://www.excelforum.com/showthread...hreadid=380380



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro ?


No, it's actually a reference back to another worksheet cell.

Basically, I have a macro that is looking for a particular entry on
sheet, it is then taking that cell and entering the actual cel
reference "G33" for example in this particular cell. Later a differen
macro is going to use the "33" portion to color code certain cells tha
end in "33", but not the "G33" cell. ie. Range("A33:C33, F33") will b
colored a specific color..

--
dok11
-----------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php...fo&userid=1058
View this thread: http://www.excelforum.com/showthread.php?threadid=38038

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Macro ?

Hi dok112

Try this with in A1 the value G33

Dim Num As Long
Num = Mid(Range("A1").Value, 2, 1024)
Range("A" & Num & ":C" & Num & ", F" & Num).Interior.ColorIndex = 3


--
Regards Ron de Bruin
http://www.rondebruin.nl


"dok112" wrote in message
...

No, it's actually a reference back to another worksheet cell.

Basically, I have a macro that is looking for a particular entry on a
sheet, it is then taking that cell and entering the actual cell
reference "G33" for example in this particular cell. Later a different
macro is going to use the "33" portion to color code certain cells that
end in "33", but not the "G33" cell. ie. Range("A33:C33, F33") will be
colored a specific color...


--
dok112
------------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php...o&userid=10581
View this thread: http://www.excelforum.com/showthread...hreadid=380380



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 recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 02:10 AM.

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

About Us

"It's about Microsoft Excel"