473,320 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Excel -Copy variable range from one sheet to another & copy formulas & then total

1
Windows XP, MS Office Excel 2003

If the tasks, I’m trying accomplish have been addressed previously (separately or in combination). Please, provide the links or keyword search to find them. I’ve been searching for code for each part of the task separately and trying to piece together multiple macros, that do something similar, to what I’m trying to accomplish in my over all task, but I’m not having a lot of luck. So, here’s the entire task, I’m trying to do, with two macros.

I was provided a spreadsheet with a macro that loads data from a SQL data base (not mine), it returns anywhere from one row to 100’s of rows. I copied this sheet to my destination workbook. The Data loads in 7 columns starting with B4:H4, with the column headings titles: Acct#, ID#, Name, Qtr1 Totals, Qtr2 Totals, Qtr3 Totals, and Qtr4 Totals.

First Macro:
I want the macro to copy the data for columns ID# thru Qtr4 Totals (C5:H5 down thru the last row with data) to another variable range on another sheet. The destination sheet range starts with rows B13:G13, with formulas to the right in columns H13, and J13:N13. H13 and N13 total the values across the row. (H-Totals Qtrs1-4 columns D:G and N totals amount from columns J thru M for each row) - column I is blank -

After or as the data is copied from the source sheet to the destination sheet, I need the macro to:
Copy the formulas in H13, and J13:N13 down for each row of data copied
Then skip a row and create a heading in Column C “Qtrly Totals as Reported:” and subtotals for columns D13:H13 and J13:N13 down thru the last row with data.
Then skip another row and put a row heading in Column C (Adjustments:).
- There could be no manual adjustments or 100’s -

Second Macro (separate macro/command button)
Then I need a macro to skip a row after the last row of manual adjustments
(There may be columns in each row with no entries, but a value will be in columns B & C (ID#, Name) and in at least one column D thru G in each row

Then create a heading in columns C "Qtrly Totals per Audit" and create final totals from the subtotals in the previous macro (Reported) and the manual adjustments in columns D thru H, and J thru N.

I hope this makes sense. I know Excel, but only a little VBA, and trying to piece together separate macros, that do something similar, but not exactly the same thing, for each step, has me pulling my hair out. Thanks in advance for any help you can give me on these macros.

Jim
Wyoming
Feb 29 '08 #1
0 3158

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Lize | last post by:
Hi, I'm writing an ASP application to open an excel workbook, then run a macro stored in the excel file, which produces outputs that will be displayed back onto my ASP application. Now the...
1
by: ST | last post by:
Hi, I'm having problems opening up excel thru my code. It will write and saveas an excel file, but the application won't open on the user's computer, excel seems to be hidden, because it shows up...
2
by: Ronny Sigo | last post by:
Hello all, As one of a few ways to let a user bring in data into my database I have made 3 excel files. Once the data are in the excel files my program checks if a required value (Taal (Dutch)...
7
by: taylor.bryant | last post by:
I am running: Win XP SP2 Excel 2002, Access 2002 (Office XP SP3) Using Visual Basic (not VB.NET) At one point (prior to XP SP2?!? - I can't pin it down), this did not happen and I was easily...
5
by: Wenke Ji | last post by:
Hi I open a Excel workbook using below API: Set ExcelServer = CreateObject("EXCEL.Application") Set TargetWorkbook = ExcelServer.Workbooks.Open (CurrentBook) Befor the programm exit , I use...
1
by: Steven | last post by:
Hello, I use the following code to make an Excel-file, which works fine with Excel 2003 (and the MS Excel 11.0 object library): Dim Excel As New Excel.Application Dim oBook As...
2
by: Powerguy | last post by:
Hi all, I am looking for a way to get the Process id (or a handle) of an EXCEL process created from within my code. For example when the following code is executed: Dim EXL As...
1
by: Randall Arnold | last post by:
I'm converting a vbscript program to vb.net. Witht he exception of .net idiosyncrasies, most of it is working well with the same code. My only problem is that some properties and methods are...
6
by: Coleen | last post by:
Hi All :-) I'm using .Net Framework 1.1, VB and need to be able to download the data from a datagrid into an Excel 2000 spreadsheet for our accounting users. Can anyone please point me to a good...
1
by: fakehitswizard | last post by:
this is the correct way to close excel with C#. I've seen alot of other bogus posts ALL over the web that don't work, how frustrating. string savepath; bool foundPID; int ourPID = 0; int...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.