LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Modules and code


Ok,

Very much a newbie to vb and excel macros. I have some coding on
one sheet that I would like to have applied to another sheet. I have
been told that this should be accomplished by inputing the vb code in a
module instead of the sheet. I have two sheets. The one that presently
has the code in it is called "master" the one that I want to apply the
code to is called "invoice". Finally, to my question: what needs to
be listed in the module code section and what needs to be listed in the
"master" code section to make this code work on the "invoice" sheet
only. I would put the code in the "invoice" sheet but because of some
other issues, i can't.

Following is a section of the code I want to implement:

Sub tax()
mytext = "ALMFG: AL MFG TAX"
For a = 1 To 9999
If Cells(a, "c") = mytext Then Cells(a, "q") = Cells(a, "e")
Next a
mytext = "SHMFG: SHELBY CO MFG TAX"
For s = 1 To 9999
If Cells(s, "c") = mytext Then Cells(s, "p") = Cells(s, "e")
Next s
mytext = "PEMFG: PELHAM MFG TAX"
For p = 1 To 9999
If Cells(p, "c") = mytext Then Cells(p, "n") = Cells(p, "e")
Next p
mytext = "HEMFG: HELENA MFG TAX"
For h = 1 To 9999
If Cells(h, "c") = mytext Then Cells(h, "o") = Cells(h, "e")
Next h

Thanks for any help, in advance...

Met


--
Metrazal
------------------------------------------------------------------------
Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648
View this thread: http://www.excelforum.com/showthread...hreadid=516149

 
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
Need Code To Print From Code Modules davidm Excel Programming 0 June 7th 05 06:11 AM
Need Code To Print From Code Modules davidm Excel Programming 0 June 7th 05 06:08 AM
VBA Code to Import VBA Modules Jeff Excel Programming 1 February 2nd 05 07:10 PM
When to code in sheet or userform modules and when to use modules Tony James Excel Programming 1 December 16th 04 10:02 PM
editing code in modules through VB mark Excel Programming 2 August 12th 04 05:20 PM


All times are GMT +1. The time now is 10:20 AM.

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

About Us

"It's about Microsoft Excel"