小编der*_*Max的帖子

VBA Excel - 在下面以相同的格式插入行,包括边框和框架

我想构建一个宏,在所选单元格下面以相同的格式插入一行.这是我到目前为止的代码:

Public Sub insertRowBelow()
ActiveCell.Offset(1).EntireRow.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromRightOrAbove
End Sub
Run Code Online (Sandbox Code Playgroud)

问题是:此代码仅部分传输格式.它确实对新行使用相同的背景颜色,但它不使用单元格的边框/框架.我怎样才能做到这一点?

excel vba

5
推荐指数
1
解决办法
8万
查看次数

VBA Excel:重命名列以便于参考

我正在编写一个脚本,将数据从Excel单元格传输到不同的单词表.到目前为止,我这样做:

    wordDoc.Bookmarks("Editor").Range.Text = Sheets("Product Eval").Range("E" & evalRow).Text
Run Code Online (Sandbox Code Playgroud)

以前计算evalRow的位置.

现在,我想避免在有人在列E之前添加列时重写整个代码.是否可以重命名整列,即使它们被移动也保留其名称,并且我可以引用特定的单元格VBA中的列名?

excel vba range excel-vba named-ranges

3
推荐指数
1
解决办法
1万
查看次数

Java:实现自己的消息队列(threadsafe)

任务是实现我自己的线程安全的消息队列.

我的方法:

public class MessageQueue {
    /**
     * Number of strings (messages) that can be stored in the queue.
     */
    private int capacity;

    /**
     * The queue itself, all incoming messages are stored in here.
     */
    private Vector<String> queue = new Vector<String>(capacity);

    /**
     * Constructor, initializes the queue.
     * 
     * @param capacity The number of messages allowed in the queue.
     */
    public MessageQueue(int capacity) {
        this.capacity = capacity;
    }

    /**
     * Adds a new message to the queue. If the …
Run Code Online (Sandbox Code Playgroud)

java concurrency message-queue

3
推荐指数
1
解决办法
5543
查看次数

Excel VBA:在同一位置复制并粘贴形状

我想复制一个工作表中的所有形状并将它们粘贴到另一工作表的同一位置。形状可以是矩形标注或图片。

到目前为止,我知道如何循环遍历旧工作表中的所有形状:

Dim s As Shape For each s in Activesheet.Shapes ... Next

如何将形状复制并粘贴到另一个工作表(例如 Sheets(“new”))中的同一位置?

excel vba shapes

3
推荐指数
1
解决办法
2万
查看次数