Hi guys,
I have a list of numbers such as:
A01
A23
A53
A64
A74
A128
B01... the goes on too approximatly D128
and i wanted to know if there is a way to assign the value to the row?
For example:
A23 in column A row 23
A53 in column A row 53
is there any method that achieves this?
Kind Regards,
Tai
Last edited by VBA Noob; 05-01-2009 at 03:25 PM.
Try this:
="A"&ROW()
If you want the "A" and the "23" to both be automatic, try this:
=ADDRESS(ROW(),COLUMN(),4)
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
=MID("ABCDEFGHIJKLMNOPQRSTUVWXYZ",COLUMN(A1),1)&ROW(A1)
copy down and across for up to 26 columns if needed
Regards
Special-K
I rarely return to a problem once I've answered it so make sure you clearly define what the trouble is.
Hey,
Thanks for the reply,
I ment from the list i want to move the values automatically to that sepecific cell. the list of numbers is in a random order, and i want the values to be in the right column and row.
A01
A23
A53 < This is the list in random order
A64
A74
A128
B01...
And i want it to be moved automatically in the correct row and column eg:
A64 must move to :
column A
Row
62
63
64 A64
and show that value
sorry guys should have made it clear at the begining, i do apologise!
Regards,
Tai
Last edited by tai10-01; 05-01-2009 at 03:38 PM.
Hi Tai,
Use this code:
Refer the attached file.Dim Cell As Object On Error Resume Next For Each Cell In Selection If Cell.Value <> "" Then ActiveSheet.Cells(Mid(Cell.Value, 2, Len(Cell.Value) - 1), Left(Cell.Value, 1)).Value = Cell.Value Cell.Value = "" End If Next
Regards,
Karan
Iv attached a sample file, so you can see what you have to deal with.
basically in the sample file you will notice there are 4 sheets each sheet has different data.
for example sheet 1:
Field1 Field 2
A13 WS42 7NE
I want the value in field 2 which is WS42 7NE to move to row A13.
Hope this clarifies thinfs
yeah karan, that is the sort of thing what i am looking for! however is it possible to move the value next to it too? check the sample data file i have attached
That's trivial at this stage, you need to resize each selection. Replace Karan's critical line with this:
But as long as we're on the topic, can someone point me to a good resource explaining Mid() better? I have been confounded in trying to find a good resource. It could be because I'm looking for a really good regular expression engine for excel, but Mid looks like it's more useful than I'd realized.ActiveSheet.Cells(Mid(Cell.Value, 2, Len(Cell.Value) - 1), Left(Cell.Value, 1)).Resize(1, 2).Value = Cell.Resize(1, 2).Value
Anyone know where a good Mid 101 is?
Thanks
Matt, please don't ask questions in someone else's thread -- start your own.
If you've not read the forum rules, now would be a good time to do so.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
My apologies. I read the rules, but I figured it was on-topic to the original question. I will go start a new thread.
Thanks.
Thanks, Matt.
VBA has excellent support for regular expressions. We can talk about it in your new thread.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks