下面这段(合并excel表)代码运行中出现下标越界,为什么 20C

Sub Collectwk2()
'ExcelHome VBA编程学习与实践
Dim Trow&, k&, arr, brr, i&, j&, book&, a&
Dim p$, f$, Rng As Range
With Application.FileDialog(msoFileDialogFolderPicker)
'取得用户选择的文件夹路径
.AllowMultiSelect = False
If .Show Then p = .SelectedItems(1) Else Exit Sub
End With
If Right(p, 1) <> "\" Then p = p & "\"
'
Trow = Val(InputBox("请输入标题的行数", "提醒"))
If Trow < 0 Then MsgBox "标题行数不能为负数。", 64, "警告": Exit Sub
Application.ScreenUpdating = False '关闭屏幕更新
Cells.ClearContents '清空当前表数据
Cells.NumberFormat = "@" '设置单元格格式为文本
ReDim brr(1 To 200000, 1 To 1)
'定义装汇总结果的数组brr,最大行数为20万行
f = Dir(p & "*.xls*")
'开始遍历指定文件夹路径下的每个工作簿
Do While f <> ""
If f <> ThisWorkbook.Name Then '避免同名文件重复打开出错
With GetObject(p & f)
'以\'只读\'形式读取文件时,使用getobject方法会比workbooks.open稍快
Set Rng = .Sheets(1).UsedRange
If IsEmpty(Rng) = False Then '如果工作表非空
book = book + 1 '标记一下是否首个Sheet,如果首个sheet,BOOK=1
a = IIf(book = 1, 1, Trow + 1) '遍历读取arr数组时是否扣掉标题行
arr = Rng.Value '数据区域读入数组arr
If UBound(arr, 2) > UBound(brr, 2) Then
'动态调整结果数组brr的最大列数,避免明细表列数不一的情况。
ReDim Preserve brr(1 To 200000, 1 To UBound(arr, 2))
End If
For i = a To UBound(arr) '遍历行
k = k + 1 '累加记录条数
For j = 1 To UBound(brr, 2) '遍历列
brr(k, j) = arr(i, j)
Next
Next
End If
.Close False '关闭工作簿,不保存。
End With
End If
f = Dir '下一个工作簿
Loop
If k > 0 Then
[a1].Resize(k, UBound(brr, 2)) = brr
MsgBox "汇总完成。"
End If
Application.ScreenUpdating = True '恢复屏幕更新
End Sub

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
下面这段代码运行时会出现什么问题?
#include rnclassA rn rnpublic: rnvoidf() rn rnprintf("A\n"); rn rn; rnclassB:publicA rn rnpublic: rnvirtualvoidf() rn rnprintf("B\n"); rn rn; rnintmain() rn rnA*a=newB; rna->f(); rndeletea; rnreturn0; rn
为什么这段代码运行不了?
<%rnIf request.Form("soutext")!=Empty thenrnResponse.Write request.Form("soutext")rnend ifrnIf Server.HTMLEncode(Request("reserch")!=Empty thenrnResponse.Write Server.HtmlEncode(Request("reseach"))rnend ifrn%>
为什么这段代码运行之后会出现exception?
main()rn rn int result = 0;rn char *s = NULL;rn s = (char*)calloc(50,sizeof(char) );rn s = "hello ";rn rn s[5] = '\0';//这里出问题,貌似不能这么赋值rn rn free(s);rn rn return 0;rnrn---------------------------------------------rn其实这个问题主要是这样影起的:rnmain()rn rn int result = 0;rn char *s = NULL;rn s = (char*)calloc(50,sizeof(char) );rn s = "hello ";rn rn result = trim(s);rn rn free(s);rn rn return 0;rnrnrnint trim( char s[] )rnrn int n;rn s[5] = '\0';rn rn for( n = strlen(s)-1; n >= 0; n-- )rn rn printf( "trim_1, n:%d s[n]:%c \n",n,s[n] );rn if( s[n] != ' ' && s[n] != '\t' && s[n] != '\n' )rn rn break;rn rn rn rn s[n+1] = '\0';//这里出问题rn return n;rn
这段代码运行出来的为什么不一样?
[code=VBScript]rn<%rnSession.CodePage=65001rnrnsearch=request.QueryString("search")rnresponse.Write(search)%> rn rn<%rnresponse.Write(server.URLEncode(search))rnrn%> rn rn<%response.Write(server.URLEncode("去"))%>[/code]rnrnrn运行结果:rn去 rn%C8%A5 rn%E5%8E%BB rnrnrn怎么弄,把search编出来是%E5%8E%BB的结果呢?
为什么这段C代码运行出错?
就是一个简单的程序把La和Lb合并且没有重复元素,不知道问题出在哪,编译通过了,但是运行错误,感觉好像是数组越界了?rn求指导...rn #include rnrn void Union(char *La, char *Lb);rn int ListLength(char *L);rn void GetElem(char *L, int i, char *e);rn int LocateElem(char *L, char *e, int (*comp)(char a, char b));rn int compare(char a, char b);rn void ListInsert(char *, int, char *);rnrn int main()rn char *La;rn char *Lb;rn int i;rn for(i = 0; i <= 10; ++i)rn La[i] = i;rn Lb[i] = i + 5;rn rn La[i] = '\0';rn Lb[i] = '\0';rn Union(La, Lb);rn for(i = 0; La[i] != '\0'; ++i)rn printf("%c\n", La[i]);rn rn return 0;rn rnrn //unite La and Lb without repeat elementsrn void Union(char *La, char *Lb)rn int La_length = ListLength(La);rn int Lb_length = ListLength(Lb);rn int i = 0;rn char *e;rn for(i; i<= Lb_length; ++i)rn GetElem(Lb, i, e);rn if(!LocateElem(La, e, compare))rn ListInsert(La, ++La_length, e);rn rn rnrn //caculate the length of Lrn int ListLength(char *L)rn int i;rn for(i = 0; *(L + i) != '\0'; ++i);rn return i;rn rnrn void GetElem(char *L, int i, char *e)rn *e = *(L + i);rn rnrn //search the element e in L, if exist return the location, else return 0rn int LocateElem(char *L, char *e, int (*comp)(char a, char b))rn int i;rn for(i = 0; *(L + i) != '\0'; ++i)rn if(comp(*(L + i), *e)) return i + 1;rn rn return 0;rn rnrn //compare the element a and brn int compare(char a, char b)rn if(a == b) return 1;rn return 0;rn rnrn //if e doesn't exit in L, insert the e in Lrn void ListInsert(char *L, int i, char *e)rn int j;rn for(j = ListLength(L) - 1; j >= i; --j)rn *(L + j + 1) = *(L + j);rn rn L[ListLength(L)] = '\0';rn *(L + i - 2) = *e;rn rnrnrnrnrnrnI don't know where the problem is.
为什么在IIS5.0下这段代码运行不了。
我是初学者,请赐教rn为什么运行不了呢?我用的是win2k+iis5.0rn<%rnSET MyFileObject=Server.CreateObject("Scripting.FileSystemObject")rnSET AppendTextFile=MyFileObject.OpenTextFile(Server.MapPath("test2.txt"),8,True)rnAppendTextFile.WriteLine(Request.servervariables("REMOTE_HOST"))rnAppendTextFile.Closernresponse.write "append ok"rn%>rnrn而这段写在另一个文件中,但和上面的在同一个目录里,却运行没问题rnrn<%rn'创建浏览器组建rnSet bc = Server.CreateObject("MSWC.BrowserType") rn%> rnrn浏览器名称: <%=bc.browser %>rn rn浏览器版本: <%=bc.version%>rn rn<% rnif (bc.frames = TRUE) thenrn%> rn支持frame rn<% else %>rn不支持frame rn<% rnend ifrn%>rn<% rnif (bc.tables = TRUE) then rn%> rn支持表格 rn<% else %>rn不支持表格 rn<% rnend if rn%>rn<% rnif (bc.BackgroundSounds = TRUE)then rn%>rn支持背景音乐 rn<% else %>rn不支持背景音乐 rnrn<% rnend ifrn%>rnrn<% rnif (bc.vbscript = TRUE) then rn%>rn支持VBscriptrn rn<% else %>rn不支持VBscript rn<% rnend ifrn%>rnrn<%rnif (bc.javascript = TRUE) then rn%>rn支持Javascriptrn rn<% else %>rn不支持Javascript rnrn<%rnend ifrnset bc=nothingrn%>
下面这段程序为什么出现错误?
下面这段程序为什么出现错误?我是想得到当前字体的unicode区间。rnrn CDC *pDC=GetDC();rn HDC hDC=pDC->GetSafeHdc();//加上这个rnrnrn GLYPHSET gly;rn ::GetFontUnicodeRanges(hDC,&gly); rn AfxMessageBox(gly.cbThis);rn
为什么出现数组下标越界的情况?
#include rnrnint main()rnrn char *str="apple ipod";rn int i;rn for(i=0;*str!='\0';i++)rn rn printf("str[%d]=%c\n",i,str[i]);rn rn rnreturn 0;rnrnrnrn问题:rn 编译没有问题,但是运行的时候出现数组下标越界的情况,请问为什么? 在循环里面不是已经设置了 " *str!='\0' " ? 为什么还出现这样的下标越界情况? 如果将 *str改成str[i]则不会。
【求助】横向合并工作表提示下标越界
工作簿中所有工作表进行横向合并,代码见附件,运行的时候总是提示下标越界,麻烦各位大神看下问题出在哪里,非常感谢
下面这段为什么不起作用?
import javax.swing.*;rnimport javax.swing.event.*;rnimport javax.swing.border.*;rnimport java.awt.*;rnimport java.awt.event.*;rnimport java.util.StringTokenizer;rnpublic class ZuoYe5 extends JFrame rnrn //JFrame jf=new JFrame();rn JPanel jp1=new JPanel();rn JTextArea jta1=new JTextArea(5,10);rn JTextArea jta2=new JTextArea(5,10);rn JButton jb1=new JButton("OK");rn rn StringTokenizer tokenizer=null;rn String text2="";rn String word[]=new String[30];rn String tempWord[]=new String[30];rn String tempString=null;rn char Chr[]=new char[20];rn int i=0,j=0,k=0,h=0;rn int index[]=new int[20];rn boolean isTheSame;rn public ZuoYe5()rn rn setTitle("作业");rn setSize(400,300);rn //jf.setLayout(new BorderLayout());rn rn jp1.setLayout(new BorderLayout());rn jp1.setBorder(new EmptyBorder(10, 10, 10, 10));rn jp1.add(jta1,BorderLayout.NORTH);rn rn rn jp1.add(jb1,BorderLayout.CENTER);rn jp1.add(jta2,BorderLayout.SOUTH);rn jb1.addActionListener(new buttonAction());rn rn getContentPane().add(jp1,BorderLayout.NORTH);rn rn setVisible(true);rn rn rn public class buttonAction implements ActionListenerrn rn public void actionPerformed(ActionEvent e)rn rn if(jta1.getText().length()==0)rn rn System.out.println("OK");rn rn elsern rn rn tokenizer=new StringTokenizer(jta1.getText());rn rn while(tokenizer.hasMoreTokens())rn rn /*word[k]=tokenizer.nextToken();rn k=k+1;*/rn tempWord[h]=tokenizer.nextToken();rn rn if(h==0||isTheSame!=true)rn rn rn word[k]=tempWord[h];rn k=k+1;rn rn //************不起作用rn if(h>0)rn rn j=0;rn dorn rn rn if(tempWord[h].equalsIgnoreCase(tempWord[j])) rn rn isTheSame=true;rn System.out.println(isTheSame);rn rn j=j+1;rn while(j
为什么这个代码运行后会出现
#include nint main(void)nn char y[3];n int n[3],m[3],i,j,temp;n n printf("请依次输入学生\n学号 姓名 成绩\n");n for(i=0;i<=2;i++)n n printf("同学%d:",i+1);n scanf("%d %s %d",&n[i],&y[i],&m[i]); n n nn for(i=0;i<2;i++)n n for(j=i+1;j<3;j++) n n if(m[i]>m[j]) n n temp=m[i]; n m[i]=m[j]; n m[j]=temp; n n n n for(i=0;i<2;i++)n n nprintf("%d %s %d",n[i],y[i],m[i]);n n![![图片说明](https://img-ask.csdn.net/upload/201711/09/1510197712_851212.png)图片说明](https://img-ask.csdn.net/upload/201711/09/1510197704_461803.png)
这段代码运行出现灾难性故障,是什么原因?
<% Dim ChartType, OutputStream, ViewTypernrn Set Chart1 = CreateObject("TeeChart.TChart")rnrn Chart1.AddSeries(0)rnrn Chart1.Series(0).FillSampleValues 20 ' 随机生成数据rnrn OutputStream=Chart1.Export.asPNG.SaveToStreamrnrn Set Chart1=Nothingrnrn Response.Binarywrite OutputStreamrnrn%>rnrn问题在这句:OutputStream=Chart1.Export.asPNG.SaveToStreamrnrn然后下次运行的时候IIS就挂了。
求救,为什么这段代码运行后会出现内存不足的提示
rnrnrn rn 汉字时间rnrnrnrnrn rn rn rnrn
为什么这段代码运行后,程序会死掉?
我在视图类中定义了一个响应菜单命令的函数,目的是要画一个不断变大的矩形,并且在函数的执行过程中,程序要能继续响应操作。代码如下(很多其他的功能我已经简化、或删除掉了):rnrnvoid CTTView::OnStartRun() rnrn CDC* pDC ;rn pDC = this->GetDC();rnrn CBrush brush( RGB(125,135,135) );rn CBrush* OldBrush = pDC->SelectObject( &brush );rnrn int j = 5000000;//做延时用rnrn for( int i = 0; i <= 100; i++ )rn rn //使程序能继续响应外部事件rn if( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE ) )rn rn ::TranslateMessage( &msg );rn ::DispatchMessage( &msg );rn rnrn //画矩形(x1, y1, x2, y2已经在程序的其他地方定义)rn pDC->Rectangle( x1, y1, x2, y2 );rn x2 += 1;rn y2 += 1;rnrn while( j-- );//延时rn j = 5000000;rn rnrn pDC->SelectObject( OldBrush );rn this->ReleaseDC( pDC );///!!!!!!!这行代码好象有问题。rnrnrn 程序运行起来后,我点击这个菜单命令,在这个函数运行到一半还未结束的时候,执行关闭程序的操作,则系统弹出一个异常错误对话框。当我去掉this->ReleaseDC( pDC )(函数中的最后一行代码)这句代码后,则程序就不发生错误了。rn 在下不知道到底是什么原因,导致这个严重的错误,希望各位兄弟指教。rn
为什么这段代码运行输出是这样的东西?
public class Demo_final rn public static void main(String[] args) rn System.out.println(circleArea(5));rn System.out.println( circleGirth(20));rn System.out.println(PI);rn System.out.println(new Demo_final().y);rn rn rn static final double PI=3.14;rn double y=2*5;rn static double circleArea(double r) rn return PI*r*r;rn rn static double circleGirth(double r)rn return PI*r*2;rn rnrnrn输出:rn78.5rn125.60000000000001 (这个是为什么???)rn3.14rn10.0
为什么这段简单的代码运行没结果
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Test_Page.aspx.vb" Inherits="Test_Page" %>rnrnrn rnrnrnrn rnrnrn rn rn rnrnrnrnrnrnrn——————————————————————————rn本来按道理是应该显示RadioButtonList的。但是,运行后,什么都没显示。rn
这段代码运行有错吗?
private void Form6_Load(object sender, System.EventArgs e)rnrnint qtyinstock;rntryrnrnsqlCommand1.CommandText="select count(床号) from 床位目录";rnsqlConnection1.Open();rnqtyinstock = (int)(sqlCommand1.ExecuteScalar());rnsqlConnection1.Close();rnrnfinallyrnrnMessageBox.Show("对吗?");rnrnlabel1.Text=qtyinstock.ToString();rnrn怎么运行老是无结果(床位数)?大家帮我看看吧!!!rn.rnrn
为什么这段代码运行结果是init fail
部分代码:rnrnimport ICTCLAS.I3S.AC.ICTCLAS50;rnrnrnpublic class ictclas_demo rn public static void main(String[] args) rn try rn ICTCLAS50 testICTCLAS50 = new ICTCLAS50();rn // 分词所需库的路径rn String argu = ".";rn // 初始化rn if (testICTCLAS50.ICTCLAS_Init(argu.getBytes("GB2312")) == false) rn System.out.println("Init Fail!");rn return;rn else rn System.out.println("Init Succeed!");rn
这段代码运行后却看不到窗体,为什么?
using System;rnusing System.Drawing;rnusing System.Collections;rnusing System.ComponentModel;rnusing System.Windows.Forms;rnusing System.Data;rnrnnamespace TrayIconApprnrn /// rn /// Summary description for Form1.rn /// rn public class TrayIcon : System.Windows.Forms.Formrn rn private System.Windows.Forms.NotifyIcon notifyIcon1;rn private System.Windows.Forms.ContextMenu contextMenu1;rn private System.Windows.Forms.MenuItem menuItem1;rn private System.Windows.Forms.MenuItem menuItem2;rn private System.Windows.Forms.MenuItem menuItem3;rn private System.Windows.Forms.MenuItem menuItem4;rn private System.Windows.Forms.RichTextBox tbox;rn private System.ComponentModel.IContainer components;rnrn public TrayIcon()rn rn //rn // Required for Windows Form Designer supportrn //rn InitializeComponent();rnrn //rn // TODO: Add any constructor code after InitializeComponent callrn //rn rnrn /// rn /// Clean up any resources being used.rn /// rn protected override void Dispose( bool disposing )rn rn if( disposing )rn rn if (components != null) rn rn components.Dispose();rn rn rn base.Dispose( disposing );rn rnrn #region Windows Form Designer generated codern /// rn /// Required method for Designer support - do not modifyrn /// the contents of this method with the code editor.rn /// rn private void InitializeComponent()rn rn this.components = new System.ComponentModel.Container();rn this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);rn this.contextMenu1 = new System.Windows.Forms.ContextMenu();rn this.menuItem1 = new System.Windows.Forms.MenuItem();rn this.menuItem2 = new System.Windows.Forms.MenuItem();rn this.menuItem3 = new System.Windows.Forms.MenuItem();rn this.menuItem4 = new System.Windows.Forms.MenuItem();rn this.tbox = new System.Windows.Forms.RichTextBox();rn this.SuspendLayout();rn // rn // notifyIcon1rn // rn this.notifyIcon1.ContextMenu = this.contextMenu1;rn this.notifyIcon1.Text = "黄易帖";rn this.notifyIcon1.Visible = true;rn // rn // contextMenu1rn // rn this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] rn this.menuItem1,rn this.menuItem2,rn this.menuItem3,rn this.menuItem4);rn // rn // menuItem1rn // rn this.menuItem1.Index = 0;rn this.menuItem1.Text = "显示";rn this.menuItem1.Click += new System.EventHandler(this.maximize);rn // rn // menuItem2rn // rn this.menuItem2.Index = 1;rn this.menuItem2.Text = "隐藏";rn this.menuItem2.Click += new System.EventHandler(this.minimize);rn // rn // menuItem3rn // rn this.menuItem3.Index = 2;rn this.menuItem3.Text = "帮助";rn this.menuItem3.Click += new System.EventHandler(this.helpme);rn // rn // menuItem4rn // rn this.menuItem4.Index = 3;rn this.menuItem4.Text = "退出";rn this.menuItem4.Click += new System.EventHandler(this.exit);rn // rn // tboxrn // rn this.tbox.BackColor = System.Drawing.Color.PapayaWhip;rn this.tbox.Dock = System.Windows.Forms.DockStyle.Fill;rn this.tbox.Location = new System.Drawing.Point(0, 0);rn this.tbox.Name = "tbox";rn this.tbox.Size = new System.Drawing.Size(242, 203);rn this.tbox.TabIndex = 0;rn this.tbox.Text = "今日要事\n9:00 与测试处联系测试事宜\n10:00 和电信局客户见面\n14:00 小组讨论数据库设计";rn // rn // TrayIconrn // rn this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);rn this.BackColor = System.Drawing.Color.Orange;rn this.CausesValidation = false;rn this.ClientSize = new System.Drawing.Size(242, 203);rn this.ContextMenu = this.contextMenu1;rn this.ControlBox = false;rn this.Controls.Add(this.tbox);rn this.MaximizeBox = false;rn this.Name = "TrayIcon";rn this.ShowInTaskbar = false;rn this.Text = "黄易帖";rn this.TopMost = true;rn this.WindowState = System.Windows.Forms.FormWindowState.Minimized;rn this.ResumeLayout(false);rnrn rn #endregionrnrn /// rn /// The main entry point for the application.rn /// rn [STAThread]rn static void Main() rn rn Application.Run(new TrayIcon());rn rnrn private void maximize(object sender, System.EventArgs e)rn rn this.WindowState = System.Windows.Forms.FormWindowState.Normal;rn if(!this.Visible)rn rn //If the Window is hidden rn //Show itrn this.Show();rn rn rnrn private void minimize(object sender, System.EventArgs e)rn rn if(this.Visible)rn rn //Hide the Applicationrn this.Hide();rn rn rnrn private void helpme(object sender, System.EventArgs e)rn rn MessageBox.Show("版权所有:XXX 2001") ;rn rnrn private void exit(object sender, System.EventArgs e)rn rn //Call the Dispose Methodrn this.Close();rn rn rnrn调试启动后不能看到窗体,这是为什么?明明定义了窗体的?我怎么能看到代码运行的效果?
这段代码运行没错,为什么??关于SysFreeString
BSTR bstrTest;rn CString szTemp="中国123的";rnrn SysFreeString(bstrTest);rn bstrTest=szTemp.AllocSysString();rn SysFreeString(bstrTest);rn SysFreeString(bstrTest);rn CString szA=bstrTest;rn AfxMessageBox(szA);rn SysFreeString(bstrTest);rn上面的代码运行没错,我不知道上面这种写法是否是正确的代码,有三个问题:rn(1)未初始化就SysFreeString,rn(2)连续两三次SysFreeStringrn(3)上面的代码是如何实现的rn本人在线恭候,多谢大侠。
请教达人,为什么这段代码运行不正常?
[code=JScript]rnrnrnrn rn rnrnrn 元素的内容rnrnrn[/code]rn上面这段代码,期望出现的是div中的文字从左到右来回浮动,但是运行后却是从左至右单向浮动,不能返回。是哪里的错误呢?
为什么这段代码运行后是空白呢?
0 ) rn rn // if they are in the database register the user id rn $_SESSION['valid_user'] = $userid; rn echo '登录成功!'; rn rn rn rn else echo '登录失败!'; rn mysql_close($db_conn); rn rnrnrnrn?> rnrnrn rn rn Home page rn'; rn echo 'Log out '; rn rn else rn rn if (isset($userid)) rn rn // if they've tried and failed to log in rn echo 'Could not log you in. '; rn rn else rn rn // they have not tried to log in yet or have logged out rn echo 'You are not logged in. '; rn rnrn // provide form to log in rn echo ' '; rn echo ' '; rn echo ' Userid:'; rn echo ' '; rn echo ' Password:'; rn echo ' '; rn echo ' '; rn echo ''; rn echo ''; rn rn?> rn rnMembers section rn rn
为什么这段代码运行以后,会卡在那边
#includern#includernusing namespace std;rnint main()rnrn int i =0;rn vector vect;rn while(cin>>i)rn rn vect.push_back(i);rn rn int *p=new int[vect.size()]();rn for(int i=0;i!=vect.size();i++,*p++)rn rn *p=vect[i];rn cout<<*p;rn rn delete [] p;rn rn return 0;rn
为什么这段代码运行会发生错误??
为什么这段代码运行会发生错误??rnrnrnrn File DetailsrnrnrnDetails of file: ".$file.""; rn$file = $current_dir.$file;rnrnecho " File data";rnecho "File last accessed: ".date("j F Y H:i", fileatime($file))." ";rnecho "File last modified: ".date("j F Y H:i", filemtime($file))." ";rnrn$user = posix_getpwuid(fileowner($file));rnecho "File owner: ".$user["name"]." ";rnrn$group = posix_getgrgid(filegroup($file)); rnecho "File group: ".$group["name"]." ";rnrnecho "File permissions: ".decoct(fileperms($file))." ";rnrnecho "File type: ".filetype($file)." ";rnrnecho "File size: ".filesize($file)." bytes ";rnrnrnecho " File tests";rnrnecho "is_dir: ".(is_dir($file)? "true" : "false")." ";rnecho "is_executable: ".(is_executable($file)? "true" : "false")." ";rnecho "is_file: ".(is_file($file)? "true" : "false")." ";rnecho "is_link: ".(is_link($file)? "true" : "false")." ";rnecho "is_readable: ".(is_readable($file)? "true" : "false")." ";rnecho "is_writable: ".(is_writable($file)? "true" : "false")." ";rnrn?>rnrnrn
能不能合并EXCEL表????
有两个表:如下所示rn 表一:rn 姓名 年龄 工资rn AA 20 200rn BB 30 300rn CC 20 400rn rn 表二:rn 姓名 年龄 奖金rn AA 20 300rn BB 30 500rn DD 40 300rnrn请问各位高手,怎样将他们合并为一个表。手工方法不算!!(我的数据很多)
Excel合并工作表
合并当前工作簿下的所有工作表,可以把EXCEL中多个表合并到一张表里
下标越界为什么???
Private Sub Command1_Click()rnDim min(1 To 4) As IntegerrnDim max(1 To 4) As IntegerrnDim a(1 To 4, 1 To 4) As IntegerrnDim b(1 To 4, 1 To 4) As IntegerrnDim z As Booleanrnz = TruernFor i = 1 To 4rn For j = 1 To 4rn a(i, j) = Rnd() * 100 + 1rn Print a(i, j),rn If j = 4 Thenrn Printrn End Ifrn Next jrnNext irnPrintrn这是我的一段程序代码,为什么我按F8 检查时它说“下标越界了”rn在线等候,一定不吝啬分数!!!!!!
这段代码运行不了
rn rnrn有的机器可以,有的机器不行rn怎么回事?rnrnJS:地址:www.88856.net/nf56/city.jsrnrn
这段代码运行不起来?
--下面的代码生成长度为8的编号,编号以BH开头,其余6位为流水号。rn--得到新编号的函数rnCREATE FUNCTION f_NextBH()rnRETURNS char(8)rnASrnBEGINrn RETURN(SELECT 'BH'+RIGHT(1000001+ISNULL(RIGHT(MAX(BH),6),0),6) FROM tb WITH(XLOCK,PAGLOCK))rnENDrnGOrnrn--在表中应用函数rnCREATE TABLE tb(rnBH char(8) PRIMARY KEY DEFAULT dbo.f_NextBH(),rncol int)rnrn--插入资料rnBEGIN TRANrn INSERT tb(col) VALUES(1)rn INSERT tb(col) VALUES(2)rn INSERT tb(col) VALUES(3)rn DELETE tb WHERE col=3rn INSERT tb(col) VALUES(4)rn INSERT tb(BH,col) VALUES(dbo.f_NextBH(),14)rnCOMMIT TRANrnrn--显示结果rnSELECT * FROM tbrn/*--结果rnBH col rn---------------- ----------- rnBH000001 1rnBH000002 2rnBH000003 4rnBH000004 14rn--*/rnrnrn我直接在SQL 查询分析器里运行这段代码,提示rnrn服务器: 消息 207,级别 16,状态 3,过程 f_NextBH,行 7rn列名 'BH' 无效。rn服务器: 消息 208,级别 16,状态 1,行 3rn对象名 'dbo.f_NextBH' 无效。rn服务器: 消息 1750,级别 16,状态 1,行 3rn未能创建约束。请参阅前面的错误信息。rnrnrn请问这是什么原因?
这段代码运行不行呢
SELECT * FROM 111 a,222 b WHERE b.vuid>0 and to_days(time())<(to_days(b.stime)+b.vday)rnrn出现错误:rn#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))<(to_days(b.stime)+b.vday) LIMIT 0, 30' at line 1rnrn请问如何修改?
这段代码运行崩溃
[code=Java]package yeelone.socket;rnrnimport android.app.Activity;rnimport android.os.Bundle;rnrnimport java.io.IOException;rnimport java.io.InputStream;rnimport java.net.DatagramPacket;rnimport java.net.DatagramSocket;rnimport java.net.ServerSocket;rnimport java.net.Socket;rnrnimport android.view.*;rnimport android.widget.Button;rnimport android.widget.TextView;rnrnrnrnrnrnpublic class activity extends Activity rn /** Called when the activity is first created. */rn rn private Button startButton =null;rn private TextView textview=null;rn rn @Overridern public void onCreate(Bundle savedInstanceState) rn super.onCreate(savedInstanceState);rn setContentView(R.layout.main);rn startButton=(Button)findViewById(R.id.startbutton);rn startButton.setOnClickListener(new startListener());rn textview=(TextView)findViewById(R.id.textview);rn rn rn rn class startListener implements Button.OnClickListenerrn rnrn @Overridern public void onClick(View v) rn // TODO Auto-generated method stubrn new ServerThread().start();rn rn rn rn rn class ServerThread extends Threadrn rn rn public void run()rn rn ServerSocket serverSocket=null;rn tryrn serverSocket=new ServerSocket(4444);rn Socket socket=serverSocket.accept();rn rn InputStream inputStream=socket.getInputStream();rn byte[] buffer =new byte[1024*4];rn int temp=0;rn while((temp=inputStream.read(buffer))!= -1)rn rn System.out.println(new String(buffer,0,temp));rn rn rn rn catch(IOException e)rn rn e.printStackTrace();rn finallyrn tryrn serverSocket.close();rn catch( IOException e)rn rn e.printStackTrace();rn rn rn rn rn rn [/code]rnrn运行之后 点击按钮之后就出错,android显示强制关闭。rn我实在找不出错在哪里,请哪位帮我看看。rn rn
数据库导入Excel时出现下标越界的解决办法
数据库导入Excel时出现下标越界的解决办法 数据库导入Excel时出现下标越界的终极办法 原因 在使用的Excel不是本机制作的情况下,“下标越界”时有发生。 解决办法 1、将新建一个工作簿,将数据选中,注意不是全选,贴于新表中再进行导入。 2、有时候上述办法无效,则需要把Excel数据导出到txt,通过txt导入数据库。但是全身份证号码等可能会不能导入。这时新建工作簿,导入txt,数据类型全选...
为什么下面这段代码不起作用?
小弟,我做了了几行代码练习。目的是想在一个SDI的VIEW中显示光标的位置,并且能画出一个矩形。但是却一点作用也没有。rnstatic indictor[]rnrn ID_INDICTOR_SEPARATOR,rn ID_INDICTOR_NUM,rn ID_INDICTOR_CAPS,rn ID_INDICTOR_SCRL,rnrn····rn····rnrnvoid CMainFrame::OnLButtonDown(UINT nFlags, CPoint point) rnrn // TODO: Add your message handler code here and/or call defaultrn if(nFlags==MK_LBUTTON)rn CString str;rn CRect* lpRect;rn lpRect=new CRect;rn lpRect->left=point.x;rn lpRect->top=point.y;rn lpRect->bottom=lpRect->top+100;rn lpRect->right=lpRect->left+100;rn // 在状态兰显示文本rn str.Format("鼠标位置:%d,%d",point.x,point.y);rn this->m_wndStatusBar.SetPaneText(0,str,TRUE);rn rn CView* pView=this->GetActiveView();rn pView->InvalidateRect(lpRect,TRUE);rn pView->UpdateWindow();rn rn CFrameWnd::OnLButtonDown(nFlags, point);rn
下面这段代码为什么通不过
#include rn#include rnusing namespace std;rn//用vector 代替二维数组rnvoid main()rnrn int i,j;rn vector> array(3);rn rn for(i=0; i<3; i++)rn array[i].resize(3);rn //setrn for(i=0; i<3; i++)rn for(j=0; j<3; j++)rn array[i][j]=i+j;rn //printrn for(i=0; i<3; i++)rn for(j=0; j<3; j++)rn cout <
下面这段为什么会错
main()rnint c1,c2;rn c1=97;rn c2=98;rnprintf(%c ,%c",c1,c2)
这段代码的红色字中为什么会出错:下标越界。
'获得默认打印机rn Dim dwSize As Longrn Dim strBuffer As String, PrinterName As String, DriverName As String, PortName As Stringrn dwSize = 255rn strBuffer = String(dwSize, vbNullChar)rn If ovi.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS Then 'WIN16rn GetProfileString "windows", "device", "", strBuffer, dwSizern Else 'WIN32rn Dim hKey As Long, dwType As Longrn RegOpenKey HKEY_CURRENT_USER, "Software/Microsoft/Windows NT/CurrentVersion/Windows", hKeyrn dwType = REG_SZrn RegQueryValueEx hKey, "Device", 0, dwType, ByVal strBuffer, dwSizern RegCloseKey hKeyrn End Ifrn Dim strArray() As Stringrn strArray = Split(Left(strBuffer, InStr(strBuffer, vbNullChar) - 1), ",")rn [color=#FF0000] PrinterName = strArray(0)rn DriverName = strArray(1)rn PortName = strArray(2)[/color]rn红色字中为什么会出错:下标越界?
将两个Excel表中的数据合并
主要用到三个函数: 1,ISERROR(判断,真值,错值) 2,INDEX(reference,Row_num,column_num,area_num) 返回引用中指定单元格区域的引用。  3,MATCH(lookup_value,lookup_array,match_type)需要查找的内容,查找的数据,匹配类型(0完全匹配) 现在有两张表,格式如下图: 现在要是将图2的OPENI
Java合并多个Excel中的Sheel表
声明:文章内容全都是自己的学习总结,如有不对的地方请大家帮忙指出。有需要沟通交流的可加我QQ群:425120333原先用jxl中的合并多个Sheel表工具类,总是报空指针异常,网上找了资料,解决办法是改工具包中的源码。看看挺麻烦的,就直接去写了一个合并的工具方法。 private final static Log logger = LogFactory.getLog(ExcelUtil.class
怎样快速查找excel表中的合并单元…
怎样快速查找excel表中的合并单元格
合并一个文件夹中的多个excel表
1。请问用vf代码怎样使一个文件夹中所有excel的表合并成一个新的excel表?rn2。请问用代码怎样使一个文件中若干个execl合并成一个新excel表?
相关热词 c# stream 复制 android c# c#监测窗口句柄 c# md5 引用 c# 判断tabtip 自己写个浏览器程序c# c# 字符串变成整数数组 c#语言编程写出一个方法 c# 转盘抽奖 c#选中treeview

相似问题

1
matlab运行时总出现带有下标的赋值维度不匹配的问题,但是数据类型也没问题啊
0
java中缀表达式转后缀表达式为何会提示下标越界?
2
java中List操作,list下标为0的元素存入redis中,代码怎么写?
3
pytyhon 用del删除列表元素时,提示越界?
1
求助大佬为什么我的代码运行时测试器会输出运行时错误(SIGABRT)?
1
python利用字典找下标(初学者)
0
哈弗曼编码,从根到叶子,权值从数组为0开始,会出问题,以下代码,知道问题出现在下标为0的权值无法编码
0
js中在tx.executeSql内赋值的数组跳出函数后不能按下标查找数组,为什么?
0
用matlab编写好了利用训练好的bp模型来预测输出的程序,转成exe单独运行老是报错,应该怎么解决呢?
3
java 从数组取出指定数量的值,相加大于等于或小于等于指定的值,取出对应的组合下标,下标不能重复
1
单链表的一些操作,没有输出。不知道哪里错了!!!求大哥帮忙!
4
matlab带有下标的赋值维度不匹配怎么解决啊
1
在Mybatis下如何使得数据库查询返回类型是一个实体类列表,且能通过整数型下标数随机访问每行指定列的值
1
appium+python3 实现微信发送语音消息(长按)
2
求助一个自己写程序中的关于TreeSet同时去重和按加入顺序存储的bug。
0
浙大PTA数据结构 堆中的路径 我错哪了?
1
求问各位大佬怎么用python获取排序后二维列表在原列表中的下标,我的代码是这样的,但是报错了
4
初学java遇到疑惑,数组下标越界,求解答!
2
C语言写这个函数怎么写呢?求助大神
0
运行hadoop 报错Error: java.lang.ArrayIndexOutOfBoundsException: 1,感觉程序没问题