insert cell value into string

S

Scott

Hello-

I have the code below which is evaluating cell (E6) and entering a
text string in (D15) based on the value. I want to replace the XXX
part of the string with the value of (A6) if each scenario. Any ideas?
Thanks in advance.

Scott

Sub Com1()

Dim myCell As Range
Set myCell = Selection


On Error Resume Next

If Range("E6").Value <= 8 Then
Range("d16").Select
ActiveCell.FormulaR1C1 = "Great job, you handled XXX calls yesterday!"
ElseIf Range("E6").Value <= 8.25 Then
Range("d16").Select
ActiveCell.FormulaR1C1 = "Way to go, your XXX calls really made a
difference!"
ElseIf Range("E6").Value <= 8.5 Then
Range("d16").Select
ActiveCell.FormulaR1C1 = "Wow, XXX calls in one day is fantastic!"

End If
myCell.Select
End Sub
 
G

Gary Keramidas

i would add these 2 lines:

dim ws as worksheet
set ws = worksheets("Sheet1")

then
ActiveCell.Value = "Wow, " & ws.Range("A1").Value & "calls in one day is
fantastic!"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

If statement to add picture based on cell value 2
Macro help 0
IF AND THEN Statement problem 9
How to Insert Variables into Formula's 4
Check Box 3
find and findnext 1
Code to big! 3
Copy Dependent On Cell Value 1

Top