bsharath
asked on
Need lines in excel as per the file
Hi,
I have a excel in which i maintain all my machine details.I used to sort them by Emp id now i need to maintain it seat wise.Is there any way i can sort them.
Say i have HC-1F-001 and i dont have HC-1F-002 and i have HC-1F-003.
Is there any way i can insert a row for HC-1F-002 inbetween these 2.
I will have a text file with all the seat no's if not found then need to insert a row.
I have 3000 seats.At present only 2500 rows so need to insert 500 rows where ever required.
Regards
Sharath
I have a excel in which i maintain all my machine details.I used to sort them by Emp id now i need to maintain it seat wise.Is there any way i can sort them.
Say i have HC-1F-001 and i dont have HC-1F-002 and i have HC-1F-003.
Is there any way i can insert a row for HC-1F-002 inbetween these 2.
I will have a text file with all the seat no's if not found then need to insert a row.
I have 3000 seats.At present only 2500 rows so need to insert 500 rows where ever required.
Regards
Sharath
ASKER
They are
HC-1F-001
to
HC-1F-200
HC-2F-001
to
HC-2F-200
HC-3F-001
to
HC-3F-200
GRP-1F-001
to
GRP-1F-190
GRP-2F-001
to
GRP-2F-260
GRP-2F-001
to
GRP-3F-190
and 2 more buildings like this...
HC-1F-001
to
HC-1F-200
HC-2F-001
to
HC-2F-200
HC-3F-001
to
HC-3F-200
GRP-1F-001
to
GRP-1F-190
GRP-2F-001
to
GRP-2F-260
GRP-2F-001
to
GRP-3F-190
and 2 more buildings like this...
you would have to write a loop in vba. there's several ways to do it. i would leave the insert until last as inserting rows while you loop becomes confusing.
for eg, loop through your current entries and assign all the missing ones according to your "known" list to an array, after which you can then go to your last cell and then add the missing the entries in new rows.
if you need help with the code let me know.
for eg, loop through your current entries and assign all the missing ones according to your "known" list to an array, after which you can then go to your last cell and then add the missing the entries in new rows.
if you need help with the code let me know.
ASKER
need help with the code....
sorry but i forgot about this one, i'll come up with some code later today
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
typo:
Loop Until lngNew > iEnd
should be
Loop Until lngNew > iEnd - 1
also remember to backup your excel file first before running the code
Loop Until lngNew > iEnd
should be
Loop Until lngNew > iEnd - 1
also remember to backup your excel file first before running the code
i think you'll have to write some vba code to loop through your list and insert new row (or set a flag for insert) when required.