I want to make macro that copies values in a1 to a100 to cell c10 everytime I click enter.(first enter a1 to c10,second enter a2 to c10 and so on to the end of the list).
Thank you in advance![]()
I want to make macro that copies values in a1 to a100 to cell c10 everytime I click enter.(first enter a1 to c10,second enter a2 to c10 and so on to the end of the list).
Thank you in advance![]()
Maybe:
![]()
Sub dogholiday() Dim x As String Dim i As Long Range("C10").ClearContents For i = 1 To Range("A" & Rows.count).End(3)(1).Row x = x & Range("A" & i).Value & ", " x = x Next i Range("C10").Value = x Range("C10").Value = Left(Range("C10"), Len(Range("C10")) - 2) Range("C10").Value = Right(Range("C10"), Len(Range("C10")) - 2) End Sub
Last edited by JOHN H. DAVIS; 05-20-2014 at 03:44 PM.
Thank you very much,but that code didn't clear c10 cell list did come like this to c10 : 4, 6, 4, 3, 2, 1, 3, 5
They should come one by one after enter: 4 enter => 4 to c10, second enter 6 to c10 and so on.
Any Idea yet?
Can you provide a sample workbook with before and after? On my test it seemed to do what you requested.
Here I try to demonstrate what I want to do. I have dog id numbers in column A and when i push enter button the first id goes to cell F1 and that dog's pedigree will be made.After second enter the second id goes to F1 and new pedigree will be made and so on
pedigree.JPG
OK I think I misunderstood. One way is too create a Sheet called "Helper" then number the cells in Column A 1 to 100 reflecting the row number.
Then you can use this macro.
Probably more elegant ways though.![]()
Sub dogholidayzz() Range("C10").ClearContents Range("A" & Sheets("Helper").Range("A1").Value).Copy Range("C10") Sheets("Helper").Range("A1").Delete End Sub
Thank you worked fine with values but not if text.
Not sure what you mean? Can you attach a file with some sample data where it doesn't work. To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks