Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code in certain sheets MAX Excel Worksheet Functions 1 February 6th 10 09:27 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
run code on opening workbook and apply code to certain sheets Jane Excel Programming 7 August 8th 05 09:15 AM
sheets(count) code Young-Hwan Choi Excel Programming 4 November 20th 03 04:10 PM
Same code in several sheets.. Soniya Excel Programming 1 September 11th 03 07:50 AM


All times are GMT +1. The time now is 12:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"