Greetings Excel Gurus,
I am trying to find an easy way of how to copy a selection of 12 cells into cells that have been merged.
i am attaching a file with example.
Any help would be appreciatted
Thanks in advance
Greetings Excel Gurus,
I am trying to find an easy way of how to copy a selection of 12 cells into cells that have been merged.
i am attaching a file with example.
Any help would be appreciatted
Thanks in advance
Rome wasn't built in a day
my initial idea was to record some macros with a prompt for user to select data to be copied..
It isn't clear what you're trying to do here. Can you update the sheet with an example?
Are you looking for a formula or a vba macro?
oh sorry:
intention is to copy any 12 cell selection into ITEM column where cells are merged due to a format of a document
This code will do it. I don't know off hand if there's a way to determine the starting row of a merge cell programmatically. May be.
The other consideration would be knowing how the value in column A relates to the start of the merged row.
Thing to remember is that excel vba references standard columns, and doesn't take into account merged columns.Please Login or Register to view this content.
Thanks. How will it work? i am just trying to understand the code here would it be possible to promp a message where user could select range for cells to be copied?
There's a couple of ways to handle specifying the locations:How you'd set it up depends on the work flow.
- form pop-up after you click on a button
- have some cells designated for input and do merge on a button click
have you tried it? it does not seem working for me. if i do it right: copy this code into a new module and run it, but before i have to have something copied right? sorry i am not good in VBA
Yes, I tested the code before posting. I used your spreadsheet as the example.
Right now the code is specific to your example. The data to copy (Source) needs to start in K4; the are to copy to (Target) starts in D3; and there are 3 rows before the next cell to copy to.
Yes, you need to have data in the source column.
If you use the code below, you can change:
- where to copy the data from by changing the values of nSCol & nSRow.
- where to copy the data to by changing the values of nTCol & nTRow
- if you change # of rows between target cells, change the value of nIncr
Please Login or Register to view this content.
hectop,
Thanks a lot! that it works like a charm and very nice communication with you.
Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.
In future, to mark your thread as Solved, you can do the following -
Select Thread Tools-> Mark thread as Solved.
Incase your issue is not solved, you can undo it as follows -
Select Thread Tools-> Mark thread as Unsolved.
Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks