Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 2094|回复: 6

[已解决]求助,删除和加1代码

[复制链接]
发表于 2011-1-4 16:28 | 显示全部楼层 |阅读模式
本帖最后由 苗春雨 于 2011-1-4 16:39 编辑

求助,删除和加1代码
最佳答案
2011-1-4 17:18
求删除和加1代码1.rar (23.63 KB, 下载次数: 4)

求删除和加1代码.rar

21.51 KB, 下载次数: 5

excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2011-1-4 16:29 | 显示全部楼层
回复

使用道具 举报

发表于 2011-1-4 16:30 | 显示全部楼层
回复

使用道具 举报

 楼主| 发表于 2011-1-4 16:38 | 显示全部楼层
附件没传上,
回复

使用道具 举报

发表于 2011-1-4 17:00 | 显示全部楼层
  1. Sub 录入保存()
  2.     Dim intS As Integer, Myr%
  3.     Dim rngC As Range
  4.     Dim strToFind As String, FirstAddress As String
  5.     Dim wSht As Worksheet

  6.     Application.ScreenUpdating = False

  7.     intS = 1
  8.     Set wSht = Worksheets("记录")
  9.     '  Myr = wSht.[c65536].End(xlUp).Row + 1
  10.     For i = 5 To 9
  11.         Myr = wSht.[c65536].End(xlUp).Row + 1
  12.         If Cells(i, 1) <> "" Then
  13.             With wSht
  14.                 .Cells(Myr, 3) = [c3].Value
  15.                 .Cells(Myr, 4) = [f3].Value
  16.                 .Cells(Myr, 5) = Cells(i, 1)
  17.                 .Cells(Myr, 6) = Cells(i, 2)
  18.                 .Cells(Myr, 7) = Cells(i, 3)
  19.                 .Cells(Myr, 8) = Cells(i, 4)
  20.                 .Cells(Myr, 9) = Cells(i, 5)
  21.                 .Cells(Myr, 10) = Cells(i, 6)
  22.                 .Cells(Myr, 11) = Cells(i, 7)
  23.                 .Cells(Myr, 12) = Cells(i, 8)
  24.             End With
  25.             Sheets("录入").Range("A5:B9,D5:H9").ClearContents
  26.             Sheets("录入").Range("F3").Value = Sheets("录入").Range("F3").Value + 1
  27.         End If
  28.     Next i
  29.     Application.ScreenUpdating = True
  30. End Sub
复制代码
另:你的代码写的忒过复杂了点。。
回复

使用道具 举报

发表于 2011-1-4 17:18 | 显示全部楼层    本楼为最佳答案   
求删除和加1代码1.rar (23.63 KB, 下载次数: 4)

评分

参与人数 2 +22 收起 理由
tkgg93 + 20
苗春雨 + 2 我很赞同

查看全部评分

回复

使用道具 举报

 楼主| 发表于 2011-1-4 20:31 | 显示全部楼层
本帖最后由 苗春雨 于 2011-1-4 20:36 编辑

老糊涂 老师你好:你的代码漏了凭证号一列,不能存数字,麻烦你再给指导一下。
   呵呵,我已经修正好了,谢谢1
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-6-15 04:19 , Processed in 0.299592 second(s), 11 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表