Adding time and counting columns.

haitran

New Member
Joined
Jan 13, 2018
Messages
11
Hi everyone, I have a macro that saves selected columns from a Sheet to a new Workbook and save it as Text file. I have a few things that I want to add to the macro and not sure how should I name the Title of this thread, please forgive me if you misunderstood something.

Here is a few things I want to add but not sure how to start. I want to add 2 mandatory columns name COI and Workpackage.These 2 columns have to be always in the chosen columns. They are not from the "Input Sheet". Column COI is just the time create the new Workbook,for exp: a cell of column COI will look like this "COI (12/21 13:03)". Column Workpackage is a counting column for each row with format main. + number. For exp: main.1, main.2...

Any help would be appreciated.
Thank you very much.

P/s: I want to attach my current macro but I can't seem to find a way to do that. Anyone know how to? Thank you.
 
The Column "A" is where users enter columns name manually. Column "A" is just a list of columns, they are not in the order that users want. Users will order those columns in list "A" in Output Order with ComboBox. So when users are putting columns in order, they don't have to remove and retype columns name every time when they re-change the order (changing their mind or some other reasons).
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
So Column "A" is for column name entry. Then this "A" list is provided in your combobox. U then select the output order box and the combobox selection is added to the output order box. When this is completed U want the columns to be displayed in the order created/presented in the output order box row. Can't U take these Row 10 inputs and just make them the column headings? Dave
 
Last edited:
Upvote 0
Sorry but I'm not quite understand your question. I want to add columns COI and WorkPackage, they are not from Sheet "InputFile", they are like extra columns beside the chosen columns from users.
 
Upvote 0
Is there any data/formula in these columns? Aren't they just blank columns with a header. Why can't you just add the new columns by adding new headers? What do you mean by new columns? Inserting columns is possible but I don't see the need. Dave
 
Upvote 0
There is data in these columns like in a picture in my second post. Data is in Sheet "InputFile". You can check again :D. Also as I mentioned in my some of my previous posts, column COI is the time that new Workbook is created, column WorkPackage is counting column.
 
Upvote 0
OK it seemed like U wanted to prepare new workbooks for users which I assumed were empty. U have mentioned that these columns that U want to add contain data and already exist but not in the inputfile sheet. Where are they or did I miss that? Dave
 
Upvote 0
Sorry but I think you misunderstand me. The macro saves selected columns to a new Workbook. So the new Workbook has the columns that were selected by users, these columns are from Sheet "Inputfile", they contain data exactly like that. Sheet "Settings" has the settings for users to choose columns and put them in order they want. The 2 extra columns COI and Workpackage that I want to add are not from Sheet "Inputfile".I want these 2 column like this, column COI has the time that the new Workbook is created in every cells. Column Workpackage is a counting column, it has format main. + number for each row. For exp: main.1 for the 1st row, main.2 for the 2nd row, etc.
 
Upvote 0
Again, where are these columns if they exist. If they don't exist, what is preventing U from manually adding them. When the user enters the columns they want in whatever order, won't U just insert the column contents in the new workbook in the column order that they specify? This would include the COI and Workpackage columns. Dave
 
Upvote 0
Because I want that when users run the macro, they will have in the new Workbook the columns they have chosen plus column COI and Workpackage. They don't have to manually insert any contents in the new Workbook. That is why I was wondering if it is possible to do that :D.
 
Upvote 0
If these columns don't already exist, why can't U just add the headers in blank columns in the new workbook. If they do exist and have data, where are they? Dave
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,387
Members
448,956
Latest member
JPav

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