小编Def*_*ick的帖子

Excel VBA循环遍历所有工作表并更改工作表颜色

我希望找到一个excel vba,它将循环遍历工作簿中的所有工作表,并按以下顺序更改工作表颜色.3,5,6,12,3,5,6,12,3,5,6,12等重复图案直至其用完纸张.下面的代码可以在随机颜色上更改它们,但我需要上面的模式.

Sub sbColorAllSheetTab()
'Declaration
Dim iCntr, sht
'This will hold the colorIndex number
iCntr = 2
'looping throgh the all the sheets of the workbook
For Each sht In ThisWorkbook.Worksheets
iCntr = iCntr + 1
'Applying the colors to Sheet tabs
sht.Tab.ColorIndex = iCntr
Next
End Sub
Run Code Online (Sandbox Code Playgroud)

任何帮助都会很棒!TY!

excel vba excel-vba

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

使用Powershell脚本将文件夹中所有文件的名称更改为文件夹名称

我有一个类似于以下的文件夹系统:

Folder A
  Folder.A.S01.E01.MP4
  Folder.A.S01.E02.MP4
  Folder.A.S02.E01.TEST.THIS.MP4
  Folder.A.S02.E01.TEST.THIS.MP4
Run Code Online (Sandbox Code Playgroud)

有没有一种方法可以遍历文件夹并重命名文件,如下所示:

Folder A
  Folder A S01E01.MP4
  Folder A S01E02.MP4
  Folder A S02E01.MP4
  Folder A S02E01.MP4
Run Code Online (Sandbox Code Playgroud)

Which I understand is just removing the . in the name of all files in the folder.

I have tried the following, but it removes the . file extension as well and "breaks" the file.

cd 'C:\Users\ME\Desktop\HERE'
dir -recurse | where {-Not $_.PsIscontainer -AND $_.name -match "."} | 
foreach {
$New=$_.name.Replace("."," ")
Rename-Item -path $_.Fullname -newname $New -passthru …
Run Code Online (Sandbox Code Playgroud)

powershell

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

标签 统计

excel ×1

excel-vba ×1

powershell ×1

vba ×1