Jump to content
Business Intelligence & Analytics for Digital Transformation

Tutorial 11 - Inputbox and MsgBox


Recommended Posts

Hi

I could do the assignment for this tutorial. Converting celsius to Fahrenheit.

I tried to add With Range and it gives me error, object require. Pls advise where my code is wrong.

Sub celcius()

Dim celcius As Integer
Dim Farenhiet As Integer


celcius = InputBox("Give me temperature in Celcius")

Range("B3").Value = celcius

Farenhiet = (celcius * 1.8) + 32

    With Range("B4").Value = Farenhiet

                .Font.Size = 11

                .Font.Color = "2367"
    
MsgBox "Farenhiet is" & " " & Farenhiet

End With

End Sub

Without using "With" it works. Do I need to use the Worksheets object. ?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...