Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Change VBA macro

Hi all,

I hope someone could help me with the following. I want to change the
VBA code below in such a way that there is only one msgbox. After the
question in this new (one and only) msgbox (question something like:
Do you want to insert the files?) all files should be put in. Does
someone know how to do so and what the code should look like?

Thanks in advance,

Wietse

VBA code:


If MsgBox("insert " & Range("rates").Value2 & " ?", vbYesNo) = vbYes
Then Run "Insertrates"
If MsgBox("insert " & Range("Deals").Value2 & " ?", vbYesNo) = vbYes
Then Run "InsertDeals"
If MsgBox("insert " & Range("Deals2").Value2 & " ?", vbYesNo) = vbYes
Then Run "InsertDeals2"
If MsgBox("insert " & Range("DealsPrev").Value2 & " ?", vbYesNo) =
vbYes Then Run "InsertDealsPrev"
If MsgBox("insert " & Range("Deals2Prev").Value2 & " ?", vbYesNo) =
vbYes Then Run "InsertDeals2Prev"
If MsgBox("insert " & Range("Deals2After").Value2 & " ?", vbYesNo) =
vbYes Then Run "InsertDeals2After"
If MsgBox("insert " & Range("rates Today").Value2 & " ?", vbYesNo) =
vbYes Then Run "InsertratesToday"
If MsgBox("insert " & Range("rates Yest").Value2 & " ?", vbYesNo) =
vbYes Then Run "InsertratesYest"
If MsgBox("insert " & Range("Sum").Value2 & " ?", vbYesNo) = vbYes
Then Run "InsertSum"
If MsgBox("insert " & Range("SumYest").Value2 & " ?", vbYesNo) = vbYes
Then Run "InsertSumYest"

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Change VBA macro

Hi

If MsgBox("Do you want to insert files?", vbYesNo) = vbYes Then
Run "Insertrates"
Run "InsertDeals"
Run "InsertDeals2"
Run "InsertDealsPrev"
Run "InsertDeals2Prev"
Run "InsertDeals2After"
Run "InsertratesToday"
Run "InsertratesYest"
Run "InsertSum"
Run "InsertSumYest"
End if

regards
Paul


On Mar 30, 9:37 am, wrote:
Hi all,

I hope someone could help me with the following. I want to change the
VBA code below in such a way that there is only one msgbox. After the
question in this new (one and only) msgbox (question something like:
Do you want to insert the files?) all files should be put in. Does
someone know how to do so and what the code should look like?

Thanks in advance,

Wietse

VBA code:

If MsgBox("insert " & Range("rates").Value2 & " ?", vbYesNo) = vbYes
Then Run "Insertrates"
If MsgBox("insert " & Range("Deals").Value2 & " ?", vbYesNo) = vbYes
Then Run "InsertDeals"
If MsgBox("insert " & Range("Deals2").Value2 & " ?", vbYesNo) = vbYes
Then Run "InsertDeals2"
If MsgBox("insert " & Range("DealsPrev").Value2 & " ?", vbYesNo) =
vbYes Then Run "InsertDealsPrev"
If MsgBox("insert " & Range("Deals2Prev").Value2 & " ?", vbYesNo) =
vbYes Then Run "InsertDeals2Prev"
If MsgBox("insert " & Range("Deals2After").Value2 & " ?", vbYesNo) =
vbYes Then Run "InsertDeals2After"
If MsgBox("insert " & Range("rates Today").Value2 & " ?", vbYesNo) =
vbYes Then Run "InsertratesToday"
If MsgBox("insert " & Range("rates Yest").Value2 & " ?", vbYesNo) =
vbYes Then Run "InsertratesYest"
If MsgBox("insert " & Range("Sum").Value2 & " ?", vbYesNo) = vbYes
Then Run "InsertSum"
If MsgBox("insert " & Range("SumYest").Value2 & " ?", vbYesNo) = vbYes
Then Run "InsertSumYest"



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Change VBA macro

One more question, how can I make sure that when the question "Do you
want to insert files?" is answered with No that then all single
msgboxes will start to ask if you want to insert the single files?

On Mar 30, 10:42 am, wrote:
Hi

If MsgBox("Do you want to insert files?", vbYesNo) = vbYes Then
Run "Insertrates"
Run "InsertDeals"
Run "InsertDeals2"
Run "InsertDealsPrev"
Run "InsertDeals2Prev"
Run "InsertDeals2After"
Run "InsertratesToday"
Run "InsertratesYest"
Run "InsertSum"
Run "InsertSumYest"
End if

regards
Paul

On Mar 30, 9:37 am, wrote:



Hi all,


I hope someone could help me with the following. I want to change the
VBA code below in such a way that there is only one msgbox. After the
question in this new (one and only) msgbox (question something like:
Do you want to insert the files?) all files should be put in. Does
someone know how to do so and what the code should look like?


Thanks in advance,


Wietse


VBA code:


If MsgBox("insert " & Range("rates").Value2 & " ?", vbYesNo) = vbYes
Then Run "Insertrates"
If MsgBox("insert " & Range("Deals").Value2 & " ?", vbYesNo) = vbYes
Then Run "InsertDeals"
If MsgBox("insert " & Range("Deals2").Value2 & " ?", vbYesNo) = vbYes
Then Run "InsertDeals2"
If MsgBox("insert " & Range("DealsPrev").Value2 & " ?", vbYesNo) =
vbYes Then Run "InsertDealsPrev"
If MsgBox("insert " & Range("Deals2Prev").Value2 & " ?", vbYesNo) =
vbYes Then Run "InsertDeals2Prev"
If MsgBox("insert " & Range("Deals2After").Value2 & " ?", vbYesNo) =
vbYes Then Run "InsertDeals2After"
If MsgBox("insert " & Range("rates Today").Value2 & " ?", vbYesNo) =
vbYes Then Run "InsertratesToday"
If MsgBox("insert " & Range("rates Yest").Value2 & " ?", vbYesNo) =
vbYes Then Run "InsertratesYest"
If MsgBox("insert " & Range("Sum").Value2 & " ?", vbYesNo) = vbYes
Then Run "InsertSum"
If MsgBox("insert " & Range("SumYest").Value2 & " ?", vbYesNo) = vbYes
Then Run "InsertSumYest"- Hide quoted text -


- Show quoted text -



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
Use Macro To Change Which Macro Assigned To Command Button CVinje Excel Discussion (Misc queries) 0 May 25th 10 09:55 PM
Insert row at change macro - how to change it. cathit Excel Discussion (Misc queries) 1 March 26th 09 07:14 PM
macro that will change the font of a cell if i change a value jk Excel Discussion (Misc queries) 2 July 29th 08 04:39 PM
Cell value change to trigger macro (worksheet change event?) Neil Goldwasser Excel Programming 4 January 10th 06 01:55 PM
Macro to change Macro code? Kaisies Excel Programming 2 March 23rd 05 03:34 AM


All times are GMT +1. The time now is 03:04 PM.

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"