Hi I have a spreadsheet with a timetable of school activities which I would like to create register for activities from.
The spreadsheet includes the activity name, school term the activity is run, start and end dates of the activity. I'm trying to automate the creation of an activity register, to do this I started with a simple macro with which prompts the user to insert the name of the activity for which they would like to create an activity for which I have.
I then want the macro to take the value entered into the input box and finds the school terms the activity is being runs of the activity and returns the terms in which the activity appears in in a list box. The user can then click on the term and from there create a register.
I also need help with code which will find the activity start and end dates (based on the activity name and term) and from that create the activity register. Massive ask I know, but I'm at a major loss with this.
All I have so far is:
Sub CreateNewRegister()
Dim ActivityName As String
Dim ActivityTerm As String
Dim NewSheet As Worksheet
Dim Rng As Range
ActivityName = InputBox("Enter the Activity Name")
If Trim(ActivityName) <> "" Then
With Sheets("Club Programme").Range("B15:B200")
Set Rng = .Find(What:=ActivityName, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Rng Is Nothing Then
MsgBox "No Activity with that name was found"
Else
End If
End With
End If
End Sub
Last edited by confused.com; 05-16-2010 at 03:22 PM. Reason: attached example
Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
Also, please use code tags when posting code.
Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks