Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-30-2015, 11:09 PM
excelledsoftware excelledsoftware is offline Macro/VBA code to select ALL text in a textbox in microsoft excel and add a new row Windows 8 Macro/VBA code to select ALL text in a textbox in microsoft excel and add a new row Office 2003
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

Ok my sincere apologies for the long time this took I had quite the issue with getting my VM up and running but its all good now. Section G had an issue. I am guessing that while I was testing the code I always had a value in the textbox this would have allowed it to work but it needs to be updating a blank textbox. Please replace section G with the new code below and it should work. I tested this 12 times.



Code:
  '***SECTION G***
  Oshp.TextFrame.Characters.Text = ""
  For CheckRow = StartRow To LastRow
    CountData = Oshp.TextFrame.Characters.Count
    If CheckRow <> LastRow Then
      Oshp.TextFrame.Characters(CountData).Insert String:=(dws.Cells(CheckRow, UseCol).Value & vbLf & " ")
    Else
      Oshp.TextFrame.Characters(CountData).Insert String:=(dws.Cells(CheckRow, UseCol).Value)
    End If
  Next CheckRow
This will also fix the issue with an extra line break at the end of your data.

Let me know if this works I will be happy to make it right.

Thanks
Reply With Quote
  #2  
Old 06-01-2015, 11:15 AM
jyfuller jyfuller is offline Macro/VBA code to select ALL text in a textbox in microsoft excel and add a new row Windows 7 64bit Macro/VBA code to select ALL text in a textbox in microsoft excel and add a new row Office 2007
Advanced Beginner
Macro/VBA code to select ALL text in a textbox in microsoft excel and add a new row
 
Join Date: Jun 2012
Posts: 32
jyfuller is on a distinguished road
Default

Hello Excelled Software,

The macro is running correctly now. I may have a few more questions as I add it to the rest of the macro I built already.

Thanks so much for your expertise and help throughout.

J
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to select an { includepicture } field code and format the picture behind text and 100% scale sanpedro Word VBA 3 03-30-2015 10:50 PM
Microsoft Word macro to find text, select all text between brackets, and delete helal1990 Word VBA 4 02-05-2015 03:52 PM
Macro/VBA code to select ALL text in a textbox in microsoft excel and add a new row VBA code for Microsoft Word macro — select text and insert footnote ndnd Word VBA 10 01-06-2015 01:47 PM
Macro/VBA code to select ALL text in a textbox in microsoft excel and add a new row Outlook 2007 Code For Matching Textbox to a Combobox in a Different Form lms Outlook 4 07-03-2013 08:34 AM
Excel 2007 - formula or macro/vba code required wrighty50 Excel Programming 3 05-13-2012 02:24 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:58 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft