LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Copy all data into one sheet and insert origin data... code am

Try reversing the two statments.

from
trg.Cells(65536, 1).End(xlUp).Offset(1).Resize(rng.Rows.Count,
rng.Columns.Count).Value = rng.Value
trg.Cells(65536, 1).End(xlUp).Offset(1,1).Resize(rng.Rows.Count,
rng.Columns.Count).Value = sht.name


to
trg.Cells(65536, 1).End(xlUp).Offset(1,1).Resize(rng.Rows.Count,
rng.Columns.Count).Value = sht.name
trg.Cells(65536, 1).End(xlUp).Offset(1).Resize(rng.Rows.Count,
rng.Columns.Count).Value = rng.Value

" wrote:

Hi,

Ive tried the amendments, but, it doesnt quite work - its putting the
sheet names next to the wrong entries. i.e. i have

sheet 1

Col A
ABC112
HGF321

Sheet 2

Col A
POL008
OOL001


What is actually being copied to the Master Sheet is


Col A
ABC112
HGF321
POL008 Sheet1
OOL001 Sheet1
..... Sheet2
..... Sheet2

Hope this makes sense...

cheers

P

 
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
how can I amend my address data source Kim New Users to Excel 2 July 5th 07 01:24 AM
Macro: Insert, copy and past data from sheet Metaldream7 Excel Discussion (Misc queries) 0 November 8th 06 09:31 PM
Data copy from a seperate sheet to data sheet ZeroXevo Excel Programming 1 June 20th 05 08:14 AM
Code to insert data from another workbook maryj Excel Programming 3 December 2nd 04 07:05 PM
Help on writing a code to copy and amend lines Karen Brown[_2_] Excel Programming 2 February 5th 04 05:51 PM


All times are GMT +1. The time now is 02:17 AM.

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

About Us

"It's about Microsoft Excel"