ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Macro. (https://www.excelbanter.com/excel-programming/340403-copy-macro.html)

mcertini

Copy Macro.
 

I currently have data that I am trying to format for importing into M
Access. For my Access database I need each record to have a DCR numbe
(number in column A). The macro I need is one that goes to a cel
location (A1), stores the cell contents and evaluates if the next cel
below in the same column is blank (A2). It also needs to evaluate i
the immediate column to the right is populated (B2). If thes
conditions are met, the program needs to copy the stored DCR numbe
into this cell (A2). It needs to then move down and store the content
of the next cell (A2) or loop through the procedure as listed above. I
the macro encounters a new DCR number in column A it needs to store i
and move through the procedures as listed above. I need to accomplis
this same process for other columns of data. (See Attached Text File

+-------------------------------------------------------------------
|Filename: Test Data.txt
|Download: http://www.excelforum.com/attachment.php?postid=3835
+-------------------------------------------------------------------

--
mcertin
-----------------------------------------------------------------------
mcertini's Profile: http://www.excelforum.com/member.php...fo&userid=2715
View this thread: http://www.excelforum.com/showthread.php?threadid=46857


Vacation's Over

Copy Macro.
 
dim c as range

for each c in activesheet.Range("A:A") if c.offset(1,0) = "" and not
c.offset(1,1) = "" Then
c.offset(1,0).value = c.value
next

"mcertini" wrote:


I currently have data that I am trying to format for importing into MS
Access. For my Access database I need each record to have a DCR number
(number in column A). The macro I need is one that goes to a cell
location (A1), stores the cell contents and evaluates if the next cell
below in the same column is blank (A2). It also needs to evaluate if
the immediate column to the right is populated (B2). If these
conditions are met, the program needs to copy the stored DCR number
into this cell (A2). It needs to then move down and store the contents
of the next cell (A2) or loop through the procedure as listed above. If
the macro encounters a new DCR number in column A it needs to store it
and move through the procedures as listed above. I need to accomplish
this same process for other columns of data. (See Attached Text File)


+-------------------------------------------------------------------+
|Filename: Test Data.txt |
|Download: http://www.excelforum.com/attachment.php?postid=3835 |
+-------------------------------------------------------------------+

--
mcertini
------------------------------------------------------------------------
mcertini's Profile: http://www.excelforum.com/member.php...o&userid=27151
View this thread: http://www.excelforum.com/showthread...hreadid=468578




All times are GMT +1. The time now is 11:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com