Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Assuming you meant it all to be in one cell:
Sub abc() With ActiveCell .Value = String(14, "x") & Chr(10) & _ String(13, "s") & Chr(10) & String(12, "b") End With End Sub Assuming you want it in separate cells and the 14, 13, 12 string lengths were intentional: Sub def() Dim i As Integer Dim arr As Variant arr = Array("x", "s", "b") For i = 1 To 3 Cells(i, 1) = String(15 - i, arr(i - 1)) Next End Sub Assuming the 14, 13, 12 string lengths were unintentional and you want them to be the same length (here set to 14): Sub ghi() Dim i As Integer Dim arr As Variant arr = Array("x", "s", "b") For i = 1 To 3 Cells(i, 1) = String(14, arr(i - 1)) Next End Sub Regards, Greg "John" wrote: I want to create within a cell the following text content: 1. xxxxxxxxxxxxxx 2. sssssssssssss 3. bbbbbbbbbbbb How can I do this? Regards, |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Compiling macro based on cell values | Excel Discussion (Misc queries) | |||
Instead of a negative number, I'd like to show zero... | Excel Worksheet Functions | |||
Cell color based upon cell value | Excel Discussion (Misc queries) | |||
cell color index comparison | New Users to Excel | |||
up to 7 functions? | Excel Worksheet Functions |