I'm creating an Excel Sheet to make a list of claims, with various specifications.
I have a sheet which contains dropdown values for different issues, but now I want to make a complete list where all specs are entered.
How do I do this? I want to get the information from fields B4 - B6 - B8 - B10 - B12 - B14 - B16 - B18 in Sheet 1 and insert them into the next available line in Sheet 3.
How can this be done with a simple button? Preferred or perhaps with a message that the form has been updated.
Asked
Active
Viewed 184 times
-2

RubberDuck
- 11,933
- 4
- 50
- 95

AgoraLive
- 81
- 3
- 10
-
1The quick answer is that you can write an Excel macro to do the heavy lifting. Here is a website which discusses your problem and even has some sample code: http://www.mrexcel.com/forum/excel-questions/650338-macro-move-data-one-sheet-another-sheet.html – Tim Biegeleisen Jan 15 '15 at 10:25
1 Answers
3
This is what I did and it works :)
Private Sub CommandButton1_Click()
Sheets("Liste").Activate
ActiveSheet.Range("A2").Select
ActiveCell.Offset(a2).Resize(1).EntireRow.Insert
Sheets("Liste").Range("A3").Value = Range("B4").Value
Sheets("Liste").Range("B3").Value = Range("B6").Value
Sheets("Liste").Range("C3").Value = Range("B8").Value
Sheets("Liste").Range("D3").Value = Range("B12").Value
Sheets("Liste").Range("E3").Value = Range("B14").Value
Sheets("Liste").Range("F3").Value = Range("B16").Value
Sheets("Liste").Range("G3").Value = Range("B18").Value
Sheets("Liste").Range("H3").Value = Range("B10").Value
Range("D4").Value = Range("B4").Value
Sheets("Forside").Activate
End Sub

AgoraLive
- 81
- 3
- 10
-
A note: Since you have activated "Sheets("Liste"), you don't need to use it anymore after that in this case. Hence, "Sheets("Liste").Range("A3").Value = Range("B4").Value" can become "Range("A3") = Range("B4")" – n8. Jan 16 '15 at 00:46
-
Check this out to improve your coding in the future - [Avoid Using Select/Activate](http://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba-macros). +1 for solving your own question though :-) Also tour on this to improve how you construct your questions in the future - [StackOverFlow Question Checklist](http://blogs.msmvps.com/jonskeet/2012/11/24/stack-overflow-question-checklist/). – L42 Jan 16 '15 at 01:58