Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-17-2015, 09:47 AM
Vibov Vibov is offline Outlook and userform Windows 7 32bit Outlook and userform Office 2010 32bit
Novice
Outlook and userform
 
Join Date: Jan 2015
Posts: 8
Vibov is on a distinguished road
Post Outlook and userform

Hi

if i have a userform that add a appointment to the calender and in the form there are some field with fixed size of 35 char. that i have set.
I would like to have this variable to allways has 35 char. even if the user only enter 4 char. and fill the rest of the variable with spaces, how do i do that?
Reply With Quote
  #2  
Old 03-18-2015, 12:14 AM
gmayor's Avatar
gmayor gmayor is offline Outlook and userform Windows 7 64bit Outlook and userform Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

maybe

Code:
Dim strValue As String
    strValue = "abc" 'the value from the userform
    If Len(strValue) > 35 Then
        strValue = Left(strValue, 35)
    Else
        Do Until Len(strValue) = 35
            strValue = strValue & Chr(32)
            'OR
            'strValue = Chr(32) & strValue
        Loop
    End If
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 03-19-2015, 04:06 AM
Vibov Vibov is offline Outlook and userform Windows 7 32bit Outlook and userform Office 2010 32bit
Novice
Outlook and userform
 
Join Date: Jan 2015
Posts: 8
Vibov is on a distinguished road
Default

Thanks, i'll will try this :-)
Do you know how to write an appointment to a shared calender?
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Code in a UserForm module to delete a Command Button which opens the userform Simoninparis Word VBA 2 09-21-2014 03:50 AM
How to copy userform text and formfield contents to outlook? odin Word VBA 7 09-09-2014 11:56 AM
Outlook and userform Is it possible to take an input from a UserForm in one document to a UserForm in a do BoringDavid Word VBA 5 05-09-2014 09:08 AM
How to get Outlook 2007 userform into template? Royzer Outlook 0 04-13-2012 10:41 AM
Outlook userform validation help aiwnjoo Outlook 0 12-08-2010 12:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:25 PM.


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