您好我有以下MACRO ......
Sub RunThis()
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
ThisWorkbook.Sheets("Conditions").Range("A27:H54").Copy
With ThisWorkbook.Sheets("Project")
.Range("A1").PasteSpecial xlPasteValues
.Range("A1").PasteSpecial xlPasteFormats
End With
ThisWorkbook.Sheets("Conditions").Range("A56:H88").Copy
With ThisWorkbook.Sheets("Project")
.Range("A29").PasteSpecial xlPasteValues
.Range("A29").PasteSpecial xlPasteFormats
End With
Call DeleteCellsWithNo
End With
**With ThisWorkbook.Sheets("Project")
.Cells("A, 1").Select
End With**
End Sub
我尝试做的是Make is select the Cell A1 - 我也试图将单元格A1的宽度格式化为自动宽度....任何想法?
编辑:WITH旁边的两颗星是我试图做的但却给我一个错误EDIT2:
With ThisWorkbook.Sheets("Project")
.Cells(1, "A").Select
.Cells(1, "A").Width = 50
End With
我有这个,但在WIDTH部分给我错误。我想我想设置宽度,因为值的长度不同,因此50适用于所有
答案 0 :(得分:1)
我可能会误解你的观点,但是如果你想自动调整你的单元格(你的专栏),这是有效的:
ThisWorkbook.Sheets("Project").Columns("A:A").AutoFit