Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
how to count/sum by function/macro to get the number of record to do copy/paste in macro | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |