Copy data to worksheet from drop down list

scrungie

New Member
Joined
Jan 29, 2005
Messages
11
I have a grade book with 17 worksheets 1 for each subject = each of the sheets are identical with the students names in col B and the data is entered manually in the corresponding cols along side the names.

What I would like is a vba solution to enter the data in a worksheet called 'datainput' = which would be identical in layout as the above subject sheets= and by the use of a drop down list with the names of the 17 subject sheets = copy the data in the 'datatinput' worksheet into the next available blank col in the worksheet selected from the drop down list=and with a command button erase the data in the 'datainput' worksheet ready to enter new data.

I hope the above is understandable,

Thanks in anticipation of a favourable reply
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi scrungie. This can very likely be done with a Worksheet_Change event. It would be much easier to help if I could see a copy of your file. You could upload your file to a free website such as www.box.com. When you upload a file to the site, it will give you a link to the file. You can post the link on this forum and then the file can be downloaded for viewing.
 
Upvote 0
Hi scrungie. Place this code into the code module for worksheet "DataInput" (not into a regular module). The code assumes that cell D7 in your "DataInput" sheet is never blank.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("I7")) Is Nothing Then Exit Sub
    Application.ScreenUpdating = False
    Dim c As Range
    For Each c In Sheets(Target.Value).Range("D7:X7")
        If c = "" Then
            Sheets("DataInput").Range("D7:D36").Copy
            Sheets(Target.Value).Cells(Target.Row, c.Column).PasteSpecial xlPasteValues
            Sheets("DataInput").Range("D7:D36").ClearContents
            Application.CutCopyMode = False
            Exit For
        End If
    Next c
    Application.ScreenUpdating = True
End Sub
 
Last edited:
Upvote 0
Hi scrungie. Click here to download the file. Let me know how it works out.
 
Upvote 0
Hi again. I just realized that you have 4 semesters. The code I have written will work only for the first semester. I have to go out now but when I get back, I will revise the code so that it will work for all four semesters and I will post the revised version for you.
 
Upvote 0
Thanks

It works but the input data should be from D5:D36 to include date otherwise working good
 
Upvote 0
Hi scrungie. Click here to download the updated file. You will notice that I have added a calendar for you to make the date entry easier. The calendar will appear when you click the date cell. Please let me know how it works out.
 
Upvote 0
Mumps

Working good as of yet, thanks. I hope that I don't have to harass you about any future ideas but the resolution you provided might make me change my mind. Again thanks alot
 
Upvote 0

Forum statistics

Threads
1,203,081
Messages
6,053,415
Members
444,662
Latest member
AaronPMH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top