vba - Button For Adding New data validation (Add new my default workbook in macro excel) -


i want make data validation entry vba excel contain lot of rules of validation.

i want make “add new validation entry button”. if click button, automatically make new workbook.

this try last night: first time, perepare 2 file of xlsm in d:\ folder (the files have same contain).

one file making validation entry first time contain “add new validation entry button”. other 1 xlsm file before input data validation contain “add new validation entry button” (name of file (original workbook). if click it, automatically copy “original workbook”, close current program, , give me new validation entry.

here code, didn't work

private sub commandbutton4_click()  dim xwb workbook dim xwbpaste workbook dim xwbopen workbook dim wcur workbook  on error resume next filename = newentryworkbook.text set wbcur = activeworkbook  set xwbcopy = workbooks.copy("d:\my macro excel\original workbook") set xwbpaste = workbooks.paste("d:\my macro excel\" & filename & ".xlsm") wbcur.close set xwbopen = workbooks.open("d:\my macro excel\" & filename & ".xlsm") end sub 

microsoft has documentation different programming languages. vba, use examples care. not using best syntax. getting overview of methods , how use them.

to make copy of wb see here. if want create new wb see here.

if add new wb remember wb-object. saveas can determine path , name.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -