You are here:

Visual Basic/Enter a Message


VBA Code
VBA Code  
QUESTION: Ravindra,

You helped me at the same code, but now I want to warn with a MsgBox that the document is not saved......could you help me?...I think yes :)

ANSWER: Sub Macro1()
Dim adu As String

adu = Range("A1").Value
If adu = "" Then
msgbox("Data Not Saved")
end if
Exit Sub

'do any operation here

End Sub

---------- FOLLOW-UP ----------

QUESTION: Hello Ravindra!

I tried this code, but didn't behave correctly.......I would like that the spreadsheet do not save if any cells is blank and show to user a warning message "Document not saved".  The range is (f6, f7, f8, f9,f10, f11). Please help me....I tried all that I know, but I've no results....

ANSWER: substitute 'F1" INSTEAD OF A1

---------- FOLLOW-UP ----------

QUESTION: Hello Ravindra!
I've a new problem!
I need a vba code to direction some screens, for example: On first screen I have some buttons, each button must be direction for a unique screen, but in this screen have some others buttons and then I will need that when I click on a specific button on this screen it direction me to a specific sheet. Follow attached a image.......I tried explanation better with a picture.. :)

press alt and f11.
choose insert userform
insert another userform

then create a macro say Macro1
with code as below:
Sub Macro1()

End Sub
put a commandbutton each on the forms and add the code:
on button in userform1

Private Sub CommandButton1_Click()
End Sub

on button in userform2

Private Sub CommandButton1_Click()
End Sub

test and make changes to suit your need. note that this is not a follow up question. you should have asked a new question.

Visual Basic

All Answers

Answers by Expert:

Ask Experts




visual basic application programming from design to access information, sql, engineering and commercial applications. access databases, excel.(VB6) basic questions in vb 2008. Optional: 1)a large number of people want me to do work which takes some time and effort. can do projects in vb 2008. Pl.note that i would like to be paid for such work. 2) if you want me to spend quality time and do special work, i expect to be paid a reasonable price for my time. 3) if you are pleased with my reply you could consider a good amount. 4) you can visit my website


programming since the past 15 years. have completed a large number of projects in Industrial applications, finance,accounts, correspondence. excel macros etc

engineering, management degrees.

Past/Present Clients
project work for a Norway company,USA company and a Canadian company completed. Freelance Project work and Teaching. helping programmers with their work
teaching vb

©2016 All rights reserved.