Trying to create a macro in VBA but getting some problems starting with it. If you can help it would be great!
Going to summarize what I need, if I made some mistake with the vba code names be patient, I'm not an expert in VBA.
This macro should have two tasks:
I have a sheet (FILLER) in a workbook that is going to be used by several users.
This sheet has a simple table with data
This sheet is saved in a online folder (cloud), as well as all the rest of the files mentioned here.
I need to create a button that will allow the user to do the following:
- Open a new sheet
- copy and paste the data from the original table to a new one
- Save the file in a specific path
Cell A1 = user name
Cell A2 = Name of brand
Cell A3 = Name of Store
When selecting the path, it should follow this rule:
If A1=x, select and open folder (d:\folder\x)
if A2=y, select and open folder (d:\folder\x\y
Save file as d:\folder\x\y\z.xls) where z=A3
This is the end of task one for the macro.
- Open file in d:\folder\data_base.xls)
- Check last row available in this sheet
- Copy and paste data from original file to this data_base sheet in this form:
A2 to An;Bn;Cn , where n is the available row.
- Copy and paste data from the original file to this data_base sheet in this form:
A4:Jn to Dn:Mn+m, where m= to rows with data in original sheet.
- Save and close data_base sheet
- Do not save data in FILLER sheet
Summing, at the end, after filling the data, the user will have, by clicking the macro, its table saved in a file at a specific path and the data saved in a general data_base sheet.
There is one thing I want to check with you.
You say you want to "open a new sheet".
Any name in mind for this new sheet (or did you mean new workbook as that would make more sense to me, otherwise you would have two of the same sheets in one workbook)?