Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Business Applications Business Applications
Search Search
Search for:
Tech Support Guy > > >

Solved: Excel Marco and Subtotal function issues


(!)

rarodrig's Avatar
rarodrig rarodrig is offline
Member with 309 posts.
THREAD STARTER
 
Join Date: Aug 2002
Location: Colorado
Experience: Intermediate
20-Jun-2012, 03:53 PM #1
Solved: Excel Marco and Subtotal function issues
Hi using Win 7 Excel 2007.

I have a multi-sheet workbook. When I did a "subtotal" on one sheet, Excel created new columns (1,2,3) for those subtotals.

When I copy a row(s) from this sheet to another, Excel insert these new columns on the new sheet.

(1) I just want the data from that row, I don't what the subtotal columns on the new sheet! How do I turn off these subtotal columns?

(2) question: I'm using a MACRO to copy the data row(s) from the first sheet to the second. When I open the Excel,
It has a "security Warning Macros have been disabled." message. What do I need to change to have the Workbook open with Marcos enable? Also does it matter if my Marco is "private" or not? Now it's not private.

Thanks!
Keebellah's Avatar
Keebellah   (Hans) Keebellah is offline Keebellah is a Trusted Advisor with special permissions. Keebellah has a Profile Picture
Computer Specs
Trusted Advisor with 5,463 posts.
 
Join Date: Mar 2008
Location: Oegstgeest, The Netherlands
Experience: Advanced
20-Jun-2012, 04:46 PM #2
Hi, the macro security question is a setting in your excel.
You have to open Excel's options window and look for 'Trust Center" and then "Trust Center Settings", here you can specify what you want Excel to consider trusted.
There isn optionTrusted Locations, here you can indicate the Files with macro's that are stored here are trusted so the warning will not appear.

Well, if you're using a macro to copy the data rows you must exclude those columns.
I have no idea why it's in a column but that's your show.

You will need to edit the macro to selct only those rows that you want copied without the sub total columns.

If it were subtotal rows then you must exclude the subtotal rows.

BTW: You should try the Excel help function and look for Truste Center, that helps too

Last edited by Keebellah; 20-Jun-2012 at 04:47 PM.. Reason: xtra infOooo
rarodrig's Avatar
rarodrig rarodrig is offline
Member with 309 posts.
THREAD STARTER
 
Join Date: Aug 2002
Location: Colorado
Experience: Intermediate
20-Jun-2012, 05:41 PM #3
Thanks Keebellah, Trusted Locations solved the security/Macro problem.

The Column issue: "the columns" that are added are not regular excel columns. These are shadow columns added by the subtotal function that just contain the subtotal brackets which show the grouping of the subtotals groups. I just converted the subtotal cells to =SUM() function. But the shadow columns didn't go away.

I just copied the data from the source into into another sheet without Subtotal which fixed that sheet,
BUT the target sheet still has those SUBTOTAL generated columns.

Last edited by rarodrig; 20-Jun-2012 at 05:50 PM..
Garf13LD's Avatar
Garf13LD Garf13LD is offline
Member with 455 posts.
 
Join Date: Apr 2012
Experience: Intermediate
20-Jun-2012, 10:07 PM #4
Add a line target_range.removesubtotal after you pasted.
rarodrig's Avatar
rarodrig rarodrig is offline
Member with 309 posts.
THREAD STARTER
 
Join Date: Aug 2002
Location: Colorado
Experience: Intermediate
21-Jun-2012, 10:25 PM #5
Here's my code. I got it from someone. So I really don't know how it works. Where would I add the new line?

Sub importActiveOptions()
Dim myCopyRow, myPasteRow As Integer

myCopyRow = 3
myPasteRow = 100


With Worksheets("OptionSum")
Do While .Cells(myCopyRow, 1) <> "EOF"
If .Cells(myCopyRow, 1) <> "active" Then
GoTo Continue
End If
.Rows(myCopyRow).Copy
Worksheets("GainLoss").Paste Destination:=Worksheets("GainLoss").Rows(myPasteRow)
myPasteRow = myPasteRow + 1
Continue:
myCopyRow = myCopyRow + 1
Loop
End With
End Sub
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑

Content Relevant URLs by vBSEO 3.3.2