Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Creating a macro where values are copied and pasted into a she

One fairly easy way is to use datafilteradvanced filterunique values only
and copy that list to the other list and copy the formula down. A macro can
automate this process.

--
Don Guillett
SalesAid Software

"BrianMo" wrote in message
...
Thanks Don that worked great now I have my one line for each Security ID.
I
have one last question though is there a way that I can make it so that
every
time there is a change in the Security Id # that it copies down that
security
Id and the corresponding total figure to my second sheet. For instance I
want it to search through the first sheet see 2824100 and copy it to my
second sheet and put the total amount in column (D). Then find 02209S103
and
copy that on the next line down and put the total in column (D) and so on
until it finishes copying all of the security Id's onto the new sheet.


"Don Guillett" wrote:

Why not just a sumproduct formula to get your sum?
=sumproduct((sheet1!a2:a22="joe")*(sheet1!b2:b22=1 )*sheet1!d2:d22)
or
=sumproduct((sheet1!a2:a22=a1)*(sheet1!b2:b22=1)*s heet1!d2:d22)

--
Don Guillett
SalesAid Software

"BrianMo" wrote in message
...
I am trying to create a macro that when run will take information from
one
sheet and copy it into another. On the first sheet called Multi basis
report
there are 4 columns. (B) Security Id, (C) Security, (D) Realized G/L,
and
(E)
Total Gain/Loss. I need to take the security Id #, the security name,
and
it's realized gain/loss and paste it onto a sheet named 2006 Sched D
changes
for transfers. The issue I am having is that on my first sheet there
are
multiple lines for each security Id instead of just one consolidated
line.
I
have created subtotals for each security so there is a single line with
the
security Id and the total column summed up. Any help that can be
offered
is
greatly appreciated.

Thanks in advance,
Brian Monaghan







  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Creating a macro where values are copied and pasted into a she

One way

Sub getunique()
With Sheets("sheet7")
..Range("A1:d12").AdvancedFilter Action:= _
xlFilterInPlace, Unique:=True
..Range("a2:d12").Copy Sheets("sheet2").Range("d12")
..ShowAllData
End With
End Sub

--
Don Guillett
SalesAid Software

"BrianMo" wrote in message
...
I must be missing something because after I use the advanced filter by
security ID unique record and try to copy it to the new worksheet it says
that you can only copy filtered data to the activesheet? I previously had
filtered the data though at least it looks like it since now there is only
one line for each security ID.

"Don Guillett" wrote:

One fairly easy way is to use datafilteradvanced filterunique values
only
and copy that list to the other list and copy the formula down. A macro
can
automate this process.

--
Don Guillett
SalesAid Software

"BrianMo" wrote in message
...
Thanks Don that worked great now I have my one line for each Security
ID.
I
have one last question though is there a way that I can make it so that
every
time there is a change in the Security Id # that it copies down that
security
Id and the corresponding total figure to my second sheet. For instance
I
want it to search through the first sheet see 2824100 and copy it to my
second sheet and put the total amount in column (D). Then find
02209S103
and
copy that on the next line down and put the total in column (D) and so
on
until it finishes copying all of the security Id's onto the new sheet.


"Don Guillett" wrote:

Why not just a sumproduct formula to get your sum?
=sumproduct((sheet1!a2:a22="joe")*(sheet1!b2:b22=1 )*sheet1!d2:d22)
or
=sumproduct((sheet1!a2:a22=a1)*(sheet1!b2:b22=1)*s heet1!d2:d22)

--
Don Guillett
SalesAid Software

"BrianMo" wrote in message
...
I am trying to create a macro that when run will take information
from
one
sheet and copy it into another. On the first sheet called Multi
basis
report
there are 4 columns. (B) Security Id, (C) Security, (D) Realized
G/L,
and
(E)
Total Gain/Loss. I need to take the security Id #, the security
name,
and
it's realized gain/loss and paste it onto a sheet named 2006 Sched D
changes
for transfers. The issue I am having is that on my first sheet
there
are
multiple lines for each security Id instead of just one consolidated
line.
I
have created subtotals for each security so there is a single line
with
the
security Id and the total column summed up. Any help that can be
offered
is
greatly appreciated.

Thanks in advance,
Brian Monaghan










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
Date changes when copied and pasted JC Excel Discussion (Misc queries) 4 August 20th 08 02:46 AM
Creating a macro where values are copied and pasted into a sheet OKROB Excel Programming 0 January 11th 07 04:03 AM
Preserving lock on cells even when copied and pasted within a sheet pdgcss Excel Discussion (Misc queries) 0 August 24th 06 11:36 PM
Worksheet_Selection Change code will not allow cell contents to be copied and pasted onto the sheet it's running on KimberlyC Excel Programming 1 July 8th 05 02:51 AM
Delete the formulas of webpage, copied & pasted on excel sheet Mustafa Abedin Excel Discussion (Misc queries) 1 June 19th 05 02:39 PM


All times are GMT +1. The time now is 01:17 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"