Excel VBA 移动活动单元格

可用 Activate 方法指定活动单元格。例如,下述过程使单元格 B5 成为活动单元格,然后将其字体设置为加粗。 Use the Activate method to specify the active cell. For example, the following procedure to cell B5 the active cell, and then set the font to bold.Sub SetActive() Worksheets(“Sheet1”).Activate Worksheets(“Sheet1”).Range(“B5”).Activate ActiveCell.Font.Bold = TrueEnd Sub 上好网提示:若要选定单元格区域,请用 Select 方法。若要使单个单元格成为活动单元格,请使用 Activate 方法。 Shanghao Network Tip: To select a range, use the Select method. To make a single cell the active cell, use the Activate method. 可用 Offset 属性来移动活动单元格。下述过程在选定区域内的活动单元格中插入文本,然后将活动单元格右移一格,但并不更改选定区域。 Offset property can be used to move the active cell. The following procedure in selected areas within the active cell into the text, then the active cell right one cell, but it does not change the selected area.Sub MoveActive() Worksheets(“Sheet1”).Activate Range(“A1:D10”).Select ActiveCell.Value = “Monthly Totals” ActiveCell.Offset(0, 1).ActivateEnd Sub
命运如同手中的掌纹,无论多曲折,终掌握在自己手中。

Excel VBA 移动活动单元格

相关文章:

你感兴趣的文章:

标签云: