Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Adding & Processing Columns

Each month I receive an Excel file with information that needs to be
processed then sent or linked to an Access database for further processing.
Essentially, the columns are AuthorizationID, SystemID, Service, and
CPUMinutes. The received file has a three row header before the column
headings and data. In order to prepare it for processing I need to remove the
heading information and add three new columns: Allocation, YearMonth, and
Type. The Allocation is derived from the AuthorizationID column, and I can
use a formula. The YearMonth is the new processing year and month in yyyymm
format; and the Type is the same for each new file, but does not come in the
received file, so I have to copy it for the amount of rows of data (each
month can have different numbers of rows).

I would like to streamline and automate the process as much as possible,
perhaps using macros or vba. I have what I would classify as a good
intermediate knowledge and experience of vba in Access, but I'm not familiar
with its use in Excel. My idea is to get the received data into the format
necessary for the Access processing and perhaps link that file so Access
handles it automatically. The idea seems on the right track to me, but a bit
cumbersome in that I'd have to also clear all the prior month data from the
linked file each time after Access processes it into a cumulative archive.
I'm not sure if I want or need to archive each processed excel file, since I
keep the original files sent to me.

I would greatly appreciate any ideas and help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Adding & Processing Columns

This sounds like something you could take a big first step on using the
macro recorder. Start with a new received file, turn on the recorder,
and modify it. Turn the recorder off. The code it generates is not the
most efficient, but it's faster than manual.

Hth,
Merjet

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Adding & Processing Columns

Thanks, I'll try that and let you know if it helps.

"merjet" wrote:

This sounds like something you could take a big first step on using the
macro recorder. Start with a new received file, turn on the recorder,
and modify it. Turn the recorder off. The code it generates is not the
most efficient, but it's faster than manual.

Hth,
Merjet


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Adding & Processing Columns

OK, I tried it. Here's my sticking point. This is a copy of the relevant part
of the macro in visual editor:

Sub copy_IDs()

Range("G2").Select
Selection.Copy
'move one cell to the left to find the end row of the data
Range("F2").Select
'move to the end of the data in column F
Selection.End(xlDown).Select
'move one cell to the right into empty column G that corresponds to the last
row
'in data column F
Range("G884").Select
'select from that cell to the top of column G
Range(Selection, Selection.End(xlUp)).Select
'this again should be a relative range designation
Range("G3:G884").Select
Range("G884").Activate
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub

The idea here is to copy the formula in the first cell of column G and fill
the column with results read from the other data columns...The new data each
month will come into row 2 (columns A thru F). Columns G, H, and I add
information not in the original data. The problem here is that once the
relative end of column F is selected, the range is identified with the
specific row number. I hope I'm clear on what I'd like to do. Can you help
now?

"Ray S." wrote:

Thanks, I'll try that and let you know if it helps.

"merjet" wrote:

This sounds like something you could take a big first step on using the
macro recorder. Start with a new received file, turn on the recorder,
and modify it. Turn the recorder off. The code it generates is not the
most efficient, but it's faster than manual.

Hth,
Merjet


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Two Columns Together Gr8 Dane[_2_] Excel Discussion (Misc queries) 17 February 13th 09 11:32 AM
Adding Columns, Then deleting old columns May Excel Discussion (Misc queries) 4 October 30th 08 04:44 PM
Adding from several columns if ... TV Excel Worksheet Functions 1 March 31st 08 04:37 AM
Why does adding columns slow down processing speed? Cheer-Phil-ly Excel Programming 5 October 12th 06 08:47 AM
adding columns Bryan[_12_] Excel Programming 1 November 21st 04 01:21 AM


All times are GMT +1. The time now is 12:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"