请求大神帮忙ps一下写两个简单的VBA

请求帮忙精简成循环语句使用的问题_vba吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:4,287贴子:
请求帮忙精简成循环语句使用的问题收藏
本人初学,请求老师们帮忙将下面程式精简成循环语句,非常感谢Sub Macro1()
With ActiveSheet.QueryTables.Add(Connection:= _
, Destination:=Range("A1"))
.Name = "all_stock_bill.php?page=1&by=hq_time&order=desc&amount=100"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
Rows("1:42").Select
Selection.Delete Shift:=xlUp
Rows("51:81").Select
Selection.Delete Shift:=xlUp
Range("A51").Select
With ActiveSheet.QueryTables.Add(Connection:= _
, Destination:=Range("A51"))
.Name = "all_stock_bill.php?page=2&by=hq_time&order=desc&amount=100"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
Rows("51:92").Select
Selection.Delete Shift:=xlUp
Rows("101:131").Select
Selection.Delete Shift:=xlUp
Range("A101").Select
With ActiveSheet.QueryTables.Add(Connection:= _
, Destination:=Range("A101"))
.Name = "all_stock_bill.php?page=3&by=hq_time&order=desc&amount=100"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
Rows("101:142").Select
Selection.Delete Shift:=xlUp
Rows("151:181").Select
Selection.Delete Shift:=xlUp
Range("A151").Select
With ActiveSheet.QueryTables.Add(Connection:= _
, Destination:=Range("A151"))
.Name = "all_stock_bill.php?page=4&by=hq_time&order=desc&amount=100"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
Rows("151:192").Select
Selection.Delete Shift:=xlUp
Rows("201:231").Select
Selection.Delete Shift:=xlUp
Range("A201").Select
With ActiveSheet.QueryTables.Add(Connection:= _
, Destination:=Range("A201"))
.Name = "all_stock_bill.php?page=5&by=hq_time&order=desc&amount=100"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
Rows("201:242").Select
Selection.Delete Shift:=xlUp
Rows("251:281").Select
Selection.Delete Shift:=xlUp
Range("A251").Select
With ActiveSheet.QueryTables.Add(Connection:= _
, Destination:=Range("A251"))
.Name = "all_stock_bill.php?page=6&by=hq_time&order=desc&amount=100"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
Rows("251:292").Select
Selection.Delete Shift:=xlUp
Rows("301:331").Select
Selection.Delete Shift:=xlUp
Range("A301").Select
With ActiveSheet.QueryTables.Add(Connection:= _
, Destination:=Range("A301"))
.Name = "all_stock_bill.php?page=7&by=hq_time&order=desc&amount=100"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
Rows("301:342").Select
Selection.Delete Shift:=xlUp
Rows("351:381").Select
Selection.Delete Shift:=xlUp
Range("A351").Select
With ActiveSheet.QueryTables.Add(Connection:= _
, Destination:=Range("A351"))
.Name = "all_stock_bill.php?page=8&by=hq_time&order=desc&amount=100"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
Rows("351:392").Select
Selection.Delete Shift:=xlUp
Rows("401:431").Select
Selection.Delete Shift:=xlUp
Range("A401").SelectEnd Sub
登录百度帐号推荐应用
为兴趣而生,贴吧更懂你。或访问本页面,您的浏览器需要支持JavaScript访问本页面,您的浏览器需要支持JavaScriptexcelVBA,写个简单代码把多个单元格的直合并到一个单元格里_百度知道
excelVBA,写个简单代码把多个单元格的直合并到一个单元格里
请问, 写简单代码单元格直合并单元格.比说, A1 A20 直放 range(&B2&), 需要循环断点止.谢谢.
Public Sub HB()Dim i As LongFor i = 1 To 20
Range(&b2&) = Range(&B2&) & Range(&A& & i)Next iEnd Sub
来自团队:
其他类似问题
为您推荐:
excelvba的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁访问本页面,您的浏览器需要支持JavaScript

我要回帖

更多关于 大神帮忙开通 花呗 的文章

 

随机推荐