Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i need length of data input into cells to be a mulitple of 78. i have worked
that out except when the input is a number only. if you input 12 i want to add 76 spaces after the "12". My code recognizes that its length is 2 and that it needs to add 76 spaces but it doesn't {code} Dim blank As Variant Dim length As Integer Dim f_fix2 As String For Each text_cell In text blank = CStr(text_cell.Value) length = Len(text_cell) Dim f_fix2 As String remnder = length Mod 78 .... check for lenth=0 or mulitple of 78 if not f_fix2 = Space(78 - remnder) text_cell.Value = blank + f_fix2 Thank you for taking a look Alfred |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find String in another string - only between spaces | Excel Worksheet Functions | |||
Removing Spaces from string | Excel Worksheet Functions | |||
counting spaces in a string | Excel Programming | |||
counting spaces in a string | Excel Programming | |||
Count Spaces In A String | Excel Programming |