i have the same question here too.
What if i want to switch from row d8 to d1 automatically using code?
i know manually it can be done.
Any idea how?
Your reply will be a great help!
i have the same question here too.
What if i want to switch from row d8 to d1 automatically using code?
i know manually it can be done.
Any idea how?
Your reply will be a great help!
thinkthinkthinkthink
burst brains with macro vb codeshttp://www.excelforum.com/showthread.php?t=584092
Hi macroDummy,
In the future please create a new thread and reference this one.
As for your query, do you want to switch the values in D8 and D1, or do you just want to move the value in D8 to D1?
To switch, this code would suffice:
![]()
Sub switchCells() Dim rng1 As Variant rng1 = Range("D1") Range("D1") = Range("D8") Range("D8") = rng1 End Sub
Hi
Thank you for your quick response. Ok,next time i will create new thread with the reference.
Sorry for not being exact.
What i want is to have values in D8 switch with the values in D1.
I will try implanting your codes right now.
Regards,
Lily
The results give me a blank on row D1.
Values in D1 to D8 successfully being switched.
But values in D8 to D1 is blank.
Regards,
Lily
Just for reference, what is the value in D1 and what is the value in D8? And are they text? Stored as text? Numeric?
I've tried a dozen different values, text strings, etc. and each time I run the code it switches the two cells perfectly.![]()
Hmm.
I don't know where i get it wrong.
Values in D1 and D8 are mixed of numbers and text.
Anyway, for your reference, here is what it looked like.
switch D8 to D1.zip
switch D8 to D1[part2].zip
Thank you pjoaquin.
Very much appreciated.
Regards,
Lily
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks