Tuesday, 15 September 2015

vba - Add To Existing Macro -



vba - Add To Existing Macro -

i see similar questions on forum adding macros, none of them solved issue me.

right when run macro below, creates new workbook 1 sheet in it. need create 3 sheets in new workbook instead of 1. please help

sub runsupplierotd() ' ' runsupplierotd macro ' ' activewindow.scrollcolumn = 2 activewindow.scrollcolumn = 3 activewindow.scrollcolumn = 4 range("h49").select activecell.formular1c1 = "vendor name" range("i49").select activewindow.scrollcolumn = 5 activewindow.scrollcolumn = 6 activewindow.scrollcolumn = 7 range("a49:s49").select range("s49").activate selection.autofilter activewindow.scrollcolumn = 2 activewindow.scrollcolumn = 3 activewindow.scrollcolumn = 4 activesheet.range("$a$49:$s$177").autofilter field:=7, criteria1:=array("#" _ , "12633", "79204", "79247", "79371", "79479", "79498", "79583", "ic3000"), operator _ :=xlfiltervalues end sub

one reply ops question of how add together sheet workbook in excel vba utilize next code:

sheets.add after:=sheets(sheets.count)

one thing recording macros in excel produces loads , loads of unnecessary code. 1 thing teaches though how things. in comments of question op asks mutual question people origin in excel vba, namely how select objects such sheets , cells. there many ways this, each using different methods such "application.goto".

a reference can found @ link below , recommend looking started in excel vba read link

http://support2.microsoft.com/kb/291308

as recording macros , examining resulting code.

hth, o

vba excel-vba excel-2010

No comments:

Post a Comment