I like Excel VBA for its macro recording function and it's programmable. I have been using it for a decade.
I like Excel VBA for its macro recording function and it's programmable. I have been using it for a decade.
Hello JOHNWRICHARDSNZ,
Welcome to Excelforum. Be a part of large Excel community. Enjoy Learning.
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
During development I would like to run a VBA procedure able to generate and put macro code text into an existing module so it's ready to run when needed. But not into the same module as the generator obviously.
Thus I need a VBA procedure that can copy text of new VBA code from a generated worksheet into an existing VBA procedure so that it will run when the program is executed.
I have a VBA procedure that generates new VBA code text into a worksheet. The new VBA code is to replace old similar code in an existing VBA procedure
(preferably within a subroutine or function or as one). The new code could replace the contents of a whole VBA module if necessary, (delete and paste).
The new code concerned is from VBA interpreting a Decision Table worksheet into a SELECT CASE statement on a worksheet.
Sample new code:
SelectCase: ' as made by running Example1 for the decision table with GENERATED CODE on for VBA
Windows(FileName).Activate
' start of code generated by the decision table processor
Select Case True
'' Case 1
Case ((Trim(WageMore) > "") = False) And (Trim(RentMore) > "") And (Trim(Paid_More) > "") _
And (RentDueDate <= Paid_Date)
GoSub ProcessRentLine: GoSub BalanceRowOut
'' Case 2
Case ((Trim(WageMore) > "") = False) And (Trim(RentMore) > "") And (Trim(Paid_More) > "") _
And ((RentDueDate <= Paid_Date) = False)
GoSub ProcessPaidLine: GoSub BalanceRowOut
'' Case 3
Case ((Trim(WageMore) > "") = False) And (Trim(RentMore) > "") And ((Trim(Paid_More) > "") = False)
GoSub ProcessRentLine: GoSub BalanceRowOut
' . . .
'' Case 14
Case ((Trim(WageMore) > "") = False) And ((Trim(RentMore) > "") = False) And ((Trim(Paid_More) > "") = False)
'' Do loop handles it
Case Else
Stop ' unexpected result
End Select
' end of code generated by the decision table processor
Return
You will need to post your question in the main forum. This is for introductions only.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks