ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro ? (https://www.excelbanter.com/excel-programming/332223-macro.html)

dok112[_36_]

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


Bob Phillips[_6_]

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




Ron de Bruin

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




dok112[_37_]

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


Ron de Bruin

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





All times are GMT +1. The time now is 03:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com