HHD
09-06-2005, 05:12 AM
Hello Forum,
I am very new to excel and VBA, so please be gentle with me. Could someone advise me how to do the following on the attached worksheet.
I receive a spreadsheet, which has heaps of data, (sometimes 20000 rows) but the only columns I need use are D and AA starting in row 7. Basically what I need is to be able to select name, start time, end time from the drop downs on the userform, press submit and the name would be pasted into column AA all rows in from start time to end time as listed in column D, then repeat until end of rows.
I usually have to do this manual, but would like to automate it. What I do is take a name (These are on the Names sheet, and are defined as a range ? it is almost always a static length), and in column AA, I place that name in every row from a start time to a finish time, then another name under that and so on until the end of the rows. (every row must end up with a name in it). The times are in column D.
I have made a userform, with 3 comboboxes, but I only know how to add the range in the rowsource properties, and the range for time could be any length, so maybe it really needs to be named by code otherwise I need to define it each time. It would be nice if the each start time was to commence from the last end time, but that may be difficult. Well for me it is anyway as I haven?t even worked out how to paste the names into the combobox values in column AA yet.
I know this is a big ask, and if someone could start me off I would be most grateful
Thanks in advance
HHD
I am very new to excel and VBA, so please be gentle with me. Could someone advise me how to do the following on the attached worksheet.
I receive a spreadsheet, which has heaps of data, (sometimes 20000 rows) but the only columns I need use are D and AA starting in row 7. Basically what I need is to be able to select name, start time, end time from the drop downs on the userform, press submit and the name would be pasted into column AA all rows in from start time to end time as listed in column D, then repeat until end of rows.
I usually have to do this manual, but would like to automate it. What I do is take a name (These are on the Names sheet, and are defined as a range ? it is almost always a static length), and in column AA, I place that name in every row from a start time to a finish time, then another name under that and so on until the end of the rows. (every row must end up with a name in it). The times are in column D.
I have made a userform, with 3 comboboxes, but I only know how to add the range in the rowsource properties, and the range for time could be any length, so maybe it really needs to be named by code otherwise I need to define it each time. It would be nice if the each start time was to commence from the last end time, but that may be difficult. Well for me it is anyway as I haven?t even worked out how to paste the names into the combobox values in column AA yet.
I know this is a big ask, and if someone could start me off I would be most grateful
Thanks in advance
HHD