vb 如何使数据对齐

我输出数据用的是vb中的richtextbox控件,如何是下列数据对齐呢???(只是其中一部分)00952.61474.3-460.73110950.391474.3-4... 我输出数据用的是vb中的richtextbox控件,如何是下列数据对齐呢???(只是其中一部分)

0 0 952.6 1474.3 -460.73
1 10 950.39 1474.3 -460.73
2 20 948.18 1474.3 -460.73
3 30 945.97 1474.3 -460.73
4 40 943.76 1474.3 -460.73
5 50 941.55 1474.3 -460.73
6 60 939.34 1474.3 -460.73
7 70 937.13 1474.3 -460.73
数据采用的是一维数组,每列为一个数组,数据长度可以确定,采用什么函数设置数据长度啊,请高手赐教。
展开
 我来答
千锋教育
2016-01-05 · 做真实的自己 用良心做教育
千锋教育
千锋教育专注HTML5大前端、JavaEE、Python、人工智能、UI&UE、云计算、全栈软件测试、大数据、物联网+嵌入式、Unity游戏开发、网络安全、互联网营销、Go语言等培训教育。
向TA提问
展开全部
1、加载管理模块
2、传值给Excel
给个实例:
Private Function ExportDetail(strFileName As String) As Boolean

Dim iRow As Long
Dim myExcel As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet

On Error GoTo ErrAction
ExportDetail = False

Set myExcel = New Excel.Application
myExcel.Visible = False
myExcel.SheetsInNewWorkbook = 1
Set xlBook = myExcel.Workbooks.Add
Set xlSheet = xlBook.Worksheets(1)

xlSheet.Columns.ClearFormats
xlSheet.Cells(1, 1) = "物料BOM【" & TreeFile.SelectedItem.Text & "】"
xlSheet.Range("A1:T1").MergeCells = True

xlSheet.Cells(2, 1) = "标题项"
xlSheet.Cells(2, 2) = "中文名称"
xlSheet.Cells(2, 3) = "英文名称"
xlSheet.Cells(2, 4) = "文档号"
xlSheet.Cells(2, 5) = "物料号"
xlSheet.Cells(2, 6) = "数量"
xlSheet.Cells(2, 7) = "总数量"
xlSheet.Cells(2, 8) = "单位"
xlSheet.Cells(2, 9) = "物料关联文档1"
xlSheet.Cells(2, 10) = "物料关联文档2"
xlSheet.Cells(2, 11) = "所属装配文档号"
xlSheet.Cells(2, 12) = "所属装配物料号"
xlSheet.Cells(2, 13) = "装配物料关联文档1"
xlSheet.Cells(2, 14) = "装配物料关联文档2"
xlSheet.Cells(2, 15) = "物料技术参数"
xlSheet.Cells(2, 16) = "物料类型"
xlSheet.Cells(2, 17) = "物料备注"
xlSheet.Cells(2, 18) = "重量"
xlSheet.Cells(2, 19) = "备注"
xlSheet.Cells(2, 20) = "清单文档号"

For iRow = 1 To DocList.ListItems.Count
xlSheet.Cells(iRow + 2, 1) = DocList.ListItems(iRow).ListSubItems(1)
xlSheet.Cells(iRow + 2, 2) = DocList.ListItems(iRow).ListSubItems(2)
xlSheet.Cells(iRow + 2, 3) = DocList.ListItems(iRow).ListSubItems(3)
xlSheet.Cells(iRow + 2, 4) = DocList.ListItems(iRow).ListSubItems(4)
xlSheet.Cells(iRow + 2, 5) = DocList.ListItems(iRow).ListSubItems(5)
xlSheet.Cells(iRow + 2, 6) = DocList.ListItems(iRow).ListSubItems(6)
xlSheet.Cells(iRow + 2, 7) = DocList.ListItems(iRow).ListSubItems(7)
xlSheet.Cells(iRow + 2, 8) = DocList.ListItems(iRow).ListSubItems(8)
xlSheet.Cells(iRow + 2, 9) = DocList.ListItems(iRow).ListSubItems(9)
xlSheet.Cells(iRow + 2, 10) = DocList.ListItems(iRow).ListSubItems(10)
xlSheet.Cells(iRow + 2, 11) = DocList.ListItems(iRow).ListSubItems(11)
xlSheet.Cells(iRow + 2, 12) = DocList.ListItems(iRow).ListSubItems(12)
xlSheet.Cells(iRow + 2, 13) = DocList.ListItems(iRow).ListSubItems(13)
xlSheet.Cells(iRow + 2, 14) = DocList.ListItems(iRow).ListSubItems(14)
xlSheet.Cells(iRow + 2, 15) = DocList.ListItems(iRow).ListSubItems(15)
xlSheet.Cells(iRow + 2, 16) = DocList.ListItems(iRow).ListSubItems(16)
xlSheet.Cells(iRow + 2, 17) = DocList.ListItems(iRow).ListSubItems(17)
xlSheet.Cells(iRow + 2, 18) = DocList.ListItems(iRow).ListSubItems(18)
xlSheet.Cells(iRow + 2, 19) = DocList.ListItems(iRow).ListSubItems(19)
xlSheet.Cells(iRow + 2, 20) = DocList.ListItems(iRow).ListSubItems(20)
Next
dl_会飞的青蛙
2008-07-09 · TA获得超过2456个赞
知道大有可为答主
回答量:3294
采纳率:0%
帮助的人:3340万
展开全部
space(10-len("123"))

比如说最长的10位 那么就全部都是那么长的!~

不足10位的补空格!~
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
兰馨谷
2008-07-09 · TA获得超过149个赞
知道小有建树答主
回答量:361
采纳率:0%
帮助的人:394万
展开全部
用vbTab隔开即可
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
sundawei789
2008-07-09
知道答主
回答量:30
采纳率:0%
帮助的人:25.7万
展开全部
呵呵,顶下。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
收起 更多回答(2)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式