Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
extend vba code to other sheets
I wrote vba code for the main sheet of my workbook but I would like th other 11 sheets to follow the same code. Is there an easy way to d this -- evil bab ----------------------------------------------------------------------- evil baby's Profile: http://www.excelforum.com/member.php...fo&userid=3198 View this thread: http://www.excelforum.com/showthread.php?threadid=51826 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
extend vba code to other sheets
Ok, I figured out how to get it to go to other worksheets but now I' getting an error. All the error says is "400" and nothing else. When I select hel nothing shows up. anybody know what this means -- evil bab ----------------------------------------------------------------------- evil baby's Profile: http://www.excelforum.com/member.php...fo&userid=3198 View this thread: http://www.excelforum.com/showthread.php?threadid=51826 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
extend vba code to other sheets
Close excel and restart. That may clear it up.
-- Regards, Tom Ogilvy "evil baby" wrote in message ... Ok, I figured out how to get it to go to other worksheets but now I'm getting an error. All the error says is "400" and nothing else. When I select help nothing shows up. anybody know what this means? -- evil baby ------------------------------------------------------------------------ evil baby's Profile: http://www.excelforum.com/member.php...o&userid=31983 View this thread: http://www.excelforum.com/showthread...hreadid=518265 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
extend vba code to other sheets
ok, I changed my code so that instead of running from one sheet and copied and pasted the code from the first sheet to the remaining sheets and it works no problem. Any idea why it would give me an error if "400" if I do something like Here is the code that I'm using http://www.rafb.net/paste/results/9oimc149.html The error happens on line 6 when it gets to sheet # 2 -- evil baby ------------------------------------------------------------------------ evil baby's Profile: http://www.excelforum.com/member.php...o&userid=31983 View this thread: http://www.excelforum.com/showthread...hreadid=518265 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
extend vba code to other sheets
400 error may have to do with attempting to assign to a protected cell.
For the 11 sheets - yeah - put the shared code an XLA Addin. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
extend vba code to other sheets
ok, I just tried to copy and paste the code to each individual worksheet. I got the same error until I changed the macro name from change_colour to change_colour2 Does this always happen? -- evil baby ------------------------------------------------------------------------ evil baby's Profile: http://www.excelforum.com/member.php...o&userid=31983 View this thread: http://www.excelforum.com/showthread...hreadid=518265 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
extend vba code to other sheets
ok just add. I have originally. Worksheets("OVERALL DS SUMMARY").Activate { 'first line is Range("G6").select all of my conditional formating code } ' then I add Worksheets("DS Admin - RC3000").Activate MsgBox "hello" Range("G6").select MsgBox "hello2" It gets to the first msgbox but then it crashes with the error "400". DS Admin and DS SUMMARY are identicle in layout but have different values -- evil baby ------------------------------------------------------------------------ evil baby's Profile: http://www.excelforum.com/member.php...o&userid=31983 View this thread: http://www.excelforum.com/showthread...hreadid=518265 |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
extend vba code to other sheets
Turns out it was just one big newb mistake. I had my code in sheet14 (OVERALL DS SUMMARY) instead of "This Workbook" thanks for trying to help though -- evil baby ------------------------------------------------------------------------ evil baby's Profile: http://www.excelforum.com/member.php...o&userid=31983 View this thread: http://www.excelforum.com/showthread...hreadid=518265 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code in certain sheets | Excel Worksheet Functions | |||
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? | Excel Worksheet Functions | |||
run code on opening workbook and apply code to certain sheets | Excel Programming | |||
sheets(count) code | Excel Programming | |||
Same code in several sheets.. | Excel Programming |