- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Excel 中创建了一个宏,它将在 Excel 中复制一个表格,并将行除以我确定的特定数字(默认 = 500 行),并为宏创建的每个部门打开不同的工作表。
使用的代码是这样的:
Sub CopyTable()
'Set dimensions
Dim Table As Range, TableArray(), _
CutValue As Integer, Cntr As Integer, _
TempArray(), Width As Integer, _
x As Integer, y As Integer, _
Height As Long, Rep As Integer, _
LoopReps As Long
'Get data
Set Table = Application.InputBox("Specify range to copy", _
Default:=ActiveCell.CurrentRegion.Address, Type:=8)
CutValue = InputBox("How many rows should the chunks be?", _
Default:=500)
Width = Table.Columns.Count
Height = Table.Rows.Count
'Write to array
TableArray = Table
ReDim TempArray(1 To CutValue, 1 To Width)
Rep = Application.WorksheetFunction.RoundUp(Height / CutValue, 0)
LoopReps = CutValue
'Loop through all new sheets
For Cntr = 0 To Rep - 1
If Height - Cntr * CutValue < CutValue Then _
LoopReps = Height - Cntr * CutValue
For x = 1 To Width
For y = 1 To LoopReps
TempArray(y, x) = TableArray(y + Cntr * CutValue, x)
Next y
Next x
Worksheets.Add
Range("A1").Resize(LoopReps, Width) = TempArray
Next Cntr
End Sub
最佳答案
这可以变得更健壮,但我会将标题抓取到一个数组中,将正文抓取到另一个数组中。
Sub CopyTable()
'Set dimensions
Dim Table As Range, TableArray(), HeaderArray(), _
CutValue As Long, Cntr As Long, _
TempArray(), Width As Long, _
x As Long, y As Long, _
Height As Long, Rep As Long, _
LoopReps As Long
'Get data
Set Table = Application.InputBox("Specify range to copy", _
Default:=ActiveCell.CurrentRegion.Address, Type:=8)
CutValue = InputBox("How many rows should the chunks be?", _
Default:=500)
With Table
Width = .Columns.Count
Height = .Rows.Count - 1 'ignore headers
HeaderArray = .Rows(1).Value
TableArray = .Rows(2).Resize(Height).Value
End With
ReDim TempArray(1 To CutValue, 1 To Width)
Rep = Application.WorksheetFunction.RoundUp(Height / CutValue, 0)
LoopReps = CutValue
'Loop through all new sheets
For Cntr = 0 To Rep - 1
If Height - Cntr * CutValue < CutValue Then _
LoopReps = Height - Cntr * CutValue
For x = 1 To Width
For y = 1 To LoopReps
TempArray(y, x) = TableArray(y + Cntr * CutValue, x)
Next y
Next x
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets.Add
ws.Range("A1").Resize(, Width).Value = HeaderArray
ws.Range("A2").Resize(LoopReps, Width) = TempArray
Next Cntr
End Sub
A1:C10,E1:F10
,只有 A1:C10
)Dim wb as Workbook
Set wb = Workbooks.Add
With wb.Worksheets(1)
.Range("A1").Resize(, Width).Value = HeaderArray
.Range("A2").Resize(LoopReps, Width) = TempArray
End With
关于excel - 如何在所有工作表中保持页眉(不是静态页眉)相同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59794864/
我想将页 footer 分放在文档的每一页上,除了第一页。 我通过扩展 TCPPDF 类并覆盖其页脚方法来创建我的自定义页脚。 然后根据文档并使用以下示例,我明白我应该使用 SetPrintHeade
我的页面分为 3 个部分。 页眉 主要 和页脚。 header 固定在顶部,大小为 109px,边框高 6px,因此 main 到顶部的边距为 109px。我希望 main 扩展到 heade
我正在构建一个网站,其中每个页面都有一个 , 和一个 . 据我了解,应用程序的入口点应包括这三个组件,并且应根据用户所在的路线呈现一个或多个附加组件。 我已经像这样构建了我的入口点: App.js
谁能告诉我为什么Footer出现在页面顶部,而我看不到Header或LayoutDiv9? 这是我添加的第二个 CSS 表,第一个是自动添加的 Fluid Grid Layout CSS 表,我根本没
我的应用程序中有这个页面: http://actibities-uniongr.rhcloud.com/pages/view-demo 如果您将浏览器的窗口缩短到小于 1000 像素并水平滚动,您会看
这个问题已经有答案了: Python command line interaction library? (3 个回答) 已关闭10 年前。 如何创建一个包含静态页眉和页脚的 Python 脚本,如下
我正在努力为我们的 Mediboard 元素提供完整的 HTML 页眉/页脚打印功能。 从长远来看,我知道 CSS3 页面媒体模块将满足我的需求,但这至少需要两三年时间。 所以我试着让它与 CSS2
我可以在每页上打印页眉,但我不熟悉打印页边距。我认为 @page css 可以工作,但它似乎不会影响页边距。如果我在正文上设置边距,它在第一页上有效,但后续页面默认从上边距开始,将页眉放在文本顶部。
有什么办法,就像 WordPress 一样,创建 header.php、theme-file.php 和 footer.php,然后使用钩子(Hook)将它们组合起来?对我来说仍然复制皮肤文件似乎
我正在努力解决以下问题。我有一个 UICollectionView,它的布局的页眉和页脚引用大小设置为一个值(比如 40.0)。当我删除/插入单元格并且集合 View 位于页眉和页脚不在屏幕上的位置时
我是 javascript 新手。我想使用 ajax 加载我的网站主模板文件(页眉、页脚、侧边栏)。我的布局文件如下所示。 布局.php header(); $ret .= $app->side
这是我的代码。内容图像曾短暂地工作,但现在消失了。 试图让Header只出现在页面顶部,图片高度为1000px。页面底部的页脚,图像高度为 1000px。内容图像需要重复以适合内容。这是一个博客,所以
我正在尝试将以下图像添加为网站内容的背景: http://webbos.co/vibration/wp-content/themes/vibration-child-theme/images/back
如何更改样式表中的页眉/页脚文本颜色? 我试过了,没有结果: footer: { parent: normal, alignment: TA_CENTER, textColor: red
我有以下 HTML,它有一个页眉、一个可滚动的内容和一个页脚,并且工作正常。 我想添加到此 HTML 的是一个包装所有三个 div 的表单,问题是一旦我用标签包装 div,布局就会中断。有什么建议吗?
我使用 jQuery 创建了具有不同状态的页眉和页脚导航。单击页脚导航时,我在更新页眉导航时遇到问题。例如,当用户单击页脚导航中的列表 1 时,我希望页眉导航也更新为相同的选择。我包含了一个 jsfi
我需要创建一个网页,其中包含正常页眉 + 粘性页脚 + 垂直拉伸(stretch)的流体内容。但是,这些位置不能是绝对的,因为我需要 780 像素的页面最小高度。 我设法使用表格完成了此操作,但我真的
我知道这可能是一件非常简单的事情,但除了很棒的 Stack Overflow 社区之外,我不知道有谁可以帮助我解决我的问题。我已经有一段时间没有在这种程度上使用 HTML/CSS 了。 我正在尝试为我
我前段时间做了一个wordpress网站。我今天刚刚看了一眼,由于某种原因,这个标志已经向东传播了。它已经厌倦了 clearfix 的 float 、文本对齐和边距:0 自动。谁能告诉我发生了什么,或
我需要帮助创建包含#header、#footer 和#main 的div 的代码。我只是不确定它在代码中的位置。我创建了一个带有 css 样式表的简单 html 页面。我并不是要任何人为我编写代码,因
我是一名优秀的程序员,十分优秀!