我有一个有3列的桌子,
ID ---- Site ---- Date
1A ----- A ----10/12/16
1A ----- B ----11/12/16
2A ----- A ----10/12/16
3A ----- A ----09/12/16
3A ----- B ----09/12/16
4A ----- A ----11/12/16
5A ----- A ----11/12/16
5A ----- B ----11/12/16
6A ----- A ----09/12/16
6A ----- B ----10/12/16
Run Code Online (Sandbox Code Playgroud)
我需要所有具有主站点的行 -
我还需要具有相同ID和相同日期的行,站点可以是不同的.
如果行具有相同的ID但具有不同的日期,那么我需要将它们过滤掉.所以表应该看起来像 -
ID ---- Site ---- Date
1A ----- A ----10/12/16
2A ----- A ----10/12/16
3A ----- A ----09/12/16
3A ----- B ----09/12/16
4A ----- A ----11/12/16
5A ----- A ----11/12/16 …Run Code Online (Sandbox Code Playgroud) 我的工作表上有大约 50 行,我正在使用 VBA 宏对其进行编辑。
当我以以下格式存储最后使用的行时
NewLastRow = ActiveSheet.UsedRange.Rows.Count
Run Code Online (Sandbox Code Playgroud)
NewLastRow 得出了第 65 行,尽管这些行中没有任何内容。
因此,我合并了一段代码来选择活动范围,并删除没有内容的行。
ActiveSheet.UsedRange.Select
'Deletes the row within the selection if the row has no data.
Dim i As Long
'Turn off aspects which could slow down process.
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
'Delete backwards.
For i = Selection.Rows.Count To 1 Step -1
If WorksheetFunction.CountA(Selection.Rows(i)) = 0 Then
Selection.Rows(i).EntireRow.Delete
End If
Next i
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
Run Code Online (Sandbox Code Playgroud)
这确实有效,但是需要很长时间。我怎样才能加快速度?
我将文件夹中的文件名存储到数组中.然后我尝试从文件名中删除字符串的".xlsx"部分,并将它们打印到电子表格中.我很难从每个数组元素中删除".xlsx"子字符串.我被认为替换功能是最好的,但还没有成功.'HERE评论表明了混乱的区域
Sub Example()
Dim FName As String
'Array to store filenames.
Dim arNames() As String
Dim myCount As Integer
Dim i As Integer
FName = Dir("G:\ExampleFolder\*.xls*")
' Run until there are no more filenames.
Do Until FName = ""
'Increment
myCount = myCount + 1
'Actively store filenames into an array.
ReDim Preserve arNames(1 To myCount)
arNames(myCount) = FName
FName = Dir
Loop
'Print array details to sheet.
For i = LBound(arNames) To UBound(arNames)
Next i
'Create a …Run Code Online (Sandbox Code Playgroud) 我一直在关注使用node.js,express和jade构建Web应用程序和数据库的本教程.
https://cozy.io/en/hack/getting-started/first-app.html
尽管布局相同,但我的index.jade没有在localhost上加载.在浏览器终端上没有错误提示原因.我已经检查过我的环境变量是否已设置,并且我已将文件路径更改为index.jade,但它没有任何区别,只是一个白色的屏幕.在我的命令提示符下,服务器正在侦听并且数据库已连接.
My environment folder is
C:\foodshop and within this I have
node_modules,
index.jade,
package.json,
shopDB.db,
simpleserver.js
Run Code Online (Sandbox Code Playgroud)
simpleserver.js包含以下内容 -
// This is the server.
var http = require('http'),
express = require('express'),
app = express(),
sqlite3 = require('sqlite3').verbose(),
db = new sqlite3.Database('shopDB.db', (function(err) {
if (!err) {
console.log("Database is connected ... \n\n");
} else {
console.log("Error connecting database, check for shopDB.db file... \n\n");
}
}));
/* We add configure directive to tell express to use Jade to
render templates */ …Run Code Online (Sandbox Code Playgroud) 我已使用附加<div>到我的页面正文
$('body').append('<div id="itemInfo"><h2>TEST</h2></div>');
Run Code Online (Sandbox Code Playgroud)
这<div>隐藏在我的CSS中.然后我<div>使用函数改变文本,如下所示.
function appendMessage(messagestring) {
$('#itemInfo h2').text(messagestring);
$('#itemInfo').fadeIn();
$('#itemInfo').fadeOut(3000);
}
Run Code Online (Sandbox Code Playgroud)
这是使用以下声明.
appendMessage("Something. ");
Run Code Online (Sandbox Code Playgroud)
问题是,我似乎无法获得<br />或/n字符在消息中工作.如何在.text()函数中使用换行符?