Link to home
Start Free TrialLog in
Avatar of sandramac
sandramac

asked on

Insert cell value into textbox

Needing a vba code to insert the value in Sheets ("Drive") cell z1 and aa1 into textbox 104, which is located on sheet("DriveTo")
Avatar of terencino
terencino
Flag of Australia image

Here's a sample of how that might be done:
Sub AddTextToBox()
With Sheets("DriveTo").Shapes.Range(Array("TextBox 104"))
OriginalText = .TextFrame2.TextRange.Characters.Text
AdditionalText = Sheets("Drive").Range("Z1").Value & vbCrLf & Sheets("Drive").Range("AA1").Value
    .TextFrame2.TextRange.Characters.Text = OriginalTextt & vbCrLf & AdditionalText
End With
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Swapnil Nirmal
Swapnil Nirmal
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial