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:
![]()
Please Login or Register to view this content.
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
Ok, based on your two examples it looks like you're trying to switch rows 1 and 8, not just cells D1 and D8. Right?
If so, try this code:
![]()
Please Login or Register to view this content.
Ok! It was a success!
Thank you Paul!
:D
hmm.
(Q1) What if i want to loop it. Over and over again. It is possible right?
Because there will be thousands set of data that will adding up to the MergeSheet.
And the same header will keep on showing up (e.g. like in row 8)
(Q2) So how it is possible to make the header be a permanent on row 1?
I hope you understand what i am trying to say here.
Best regards,
Lily
Yes, it is possible to do both of those things, but you'll probably need to provide an Excel example of your data, not a picture of your Excel data in Word.
I'm not quite grasping what you're trying to say about the header that keeps showing up in row 8. Does it show up there because you're pasting data, or do you have thousands of lines of data and every 8th row has this heading? Things like that might help sort it out. Looping the code I provided won't really get you much.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks