VBA宏问题 [英] VBA Macros issue

查看:54
本文介绍了VBA宏问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个宏脚本,它将excel数据上传到orcale数据库,它也会在其他位置生成excel表并且工作正常,但每当我运行宏时,它将从excel表和更新的数据库中获取所有行,所以我得到了相同的数据一次又一次。

请任何人帮我如何只更新从excel到数据库的更改行。


以下是我的代码:

I wrote a macro script which will upload excel data into orcale database also it generate excel sheet in othet location and its working fine, but whenever i run the macro it will take all rows from excel sheet and updated database so i am getting same data again and again.
Please can any one help me how to update only changed rows from excel to database.

Below is my code:

展开 | 选择 | Wrap | 行号

推荐答案




OK ..我会告诉你日志ic,并负责编码...


在一栏中,比如第20栏,保存行的上传状态..,

最初,它将为空白..

如果该列为空,则上传数据..并立即使该Cell值=" T"或者什么...

下次当你上传上传数据时该列是否为空白..


在Excel中,为其余部分写宏列,所以如果任何列被更改,然后将列20'的单元格留空...


所以代码将更改为:

Hi,

OK.. I will just give you the logic, and take care of coding...

In One Column, say column 20, Save Upload Status of the row..,
initially, it will be blank..
upload the data for if that column is blank.. and immediately make that Cell value = "T" or something...
next time when you Upload upload the data for if that column is blank..

In Excel, write macro for the rest of the columns, so that if any column is changed, then make the column 20''s cell blank...


so the code would change to :

展开 | 选择 | Wrap | 行号


@ QVeen72


Hi Veena,谢谢你的回复

我尝试了你的提示,但它不适合我,当我的excel表更新时说2行,当我运行宏时,它只需要将两行更新到数据库但不更新。如果我使用我的代码,它会再次从excel表更新整个数据。


请其他任何提示请分享


谢谢

Teja
@QVeen72
Hi Veena, Thanks for your reply
I tried your tips but its not working for me, When my excel sheet updated say with 2 rows when i run macro it has to updated only that two rows into database but its not updating. If i use my code it is updated whole data from excel sheet again.

Please any other Tips please share

Thanks
Teja





您为了更新Cell 20而编写了什么宏....?发布
Hi,

What Macro have you written to update Cell 20....? Post it


这篇关于VBA宏问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆