LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default make macro change (delete) its own code

Sorry, slight typo, should be

Public RunBefore as Boolean

Sub as_sass_Proc()
Dim check

If Not RunBefore Then
check = 12345
RunBefore = True
Else
check = 98765
EndIf

ans = InputBox("Supply Value")

If ans = check Then
'etc.


End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Bob Phillips" wrote in message
...
This is the sort of thing I mean

Public RunBefore as Boolean

Sub as_sass_Proc()
Dim check

If Not RunBefore Then
check = 12345
RunBefore = False
Else
check = 98765
EndIf

ans = InputBox("Supply Value")

If ans = check Then
'etc.


End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"as_sass " wrote in message
...
Bob,

sounds good, if I only knew how that worked... Basically what I need is
some variable in my macro that is set to a specific value, but that
value changes to something new once the macro is executed.

As I'm new with this, I'll rephrase it to improve the chance that sb
understands me:

Let's say I'm setting
check = 12345
And then have an InputBox where the user inputs a 5 digit code.
Then the input is compared with "check" (If..Then).
Afterwards, "check" should be set to a new, predetermined value.

It may well be that what you wrote is exactly it, only I really don't
know what you mean...

Thank you so much for your help!

as


---
Message posted from http://www.ExcelForum.com/







 
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
Macro code to delete conditional formatting Bovine Jones Excel Discussion (Misc queries) 5 October 19th 06 08:39 AM
how do i change or make this macro??? pictures and code included dispelthemyth Charts and Charting in Excel 0 March 17th 06 01:02 AM
Delete VBA code in worksheet through a macro Chip Pearson Excel Programming 1 July 23rd 04 09:35 AM
Delete VBA code in worksheet through a macro Ken Wright Excel Programming 0 July 22nd 04 08:59 PM
Change code to make worksheets instead of workbooks mikeb1[_4_] Excel Programming 3 December 15th 03 03:23 PM


All times are GMT +1. The time now is 11:46 PM.

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"