首页  编辑  

字符串赋值给行或者多个单元格

Tags: /计算机文档/Office/   Date Created:

如何把一个字符串如TAB分隔,逗号分隔的字符串,自动分割然后赋值一行的多个单元格或连续的单元格?

 Dim str As String

 Dim aryStrings() As String

 str = "SITE NAME,LONGITUDE,LATITUDE,Cell NAME,PN,Frequency,Frequency,Frequency,EV PN,EV Freq,EVFreq,EVFreq,BID,NID,SID,NCELLNAME,MCC,MNC,OMCR,MSC,BSC,ANTENNA HEIGHT,AZIMUTH,TILT,POWER,GROUND HEIGHT,3dB Power Beamwidth,LAC,Traffic,Call Established Rate,Dropped CallRate,Hard Handover Success Rate,Soft Handover Success Rate,BTS Type"

 aryStrings = Split(str, ",")

 Sheets("Sheet1").Range("A1:AB1").Value = aryStrings()