Remember to always please give a link to everywhere else that you post, for example
http://www.eileenslounge.com/viewtopic.php?f=30&t=34508 http://www.eileenslounge.com/viewtopic.php?f=30&t=34508
If you have posted anywhere else then please tell us where
In the macro I have done for you , there are two possibilities.
You only need one
You can choose
' 2b)(i) Relative formula references ...
ORCode:' 2b)(i) Relative formula references ... https://teylyn.com/2017/03/21/dollarsigns/#comment-191 Ws2.Cells.NumberFormat = "General" ' May be needed to prevent formulas coming out as test =[3.xlsx]Sheet1!$A$1 Let rngOut.Value = "='[3.xlsx]" & Ws3.Name & "'!A$1" Let rngOut.Value = rngOut.Value ' Change Formulas to values Let rngOut.Value = Evaluate("If({1},SUBSTITUTE(" & rngOut.Address & ", ""0"", """"))") ' https://excelribbon.tips.net/T010741_Removing_Spaces ' Or '' 2b)(ii) Copy paste 'Dim rngIn As Range ' Set rngIn = Ws3.Range("A1:" & Lc3Ltr & "1") ' rngIn.Copy ' rngOut.PasteSpecial Paste:=xlPasteValues ' understanding Paste across ranges of different size to Copy range : https://excelfox.com/forum/showthread.php/2221-VBA-Range-Insert-Method-Code-line-makes-a-space-to-put-new-range-in?p=10441&viewfull=1#post10441
' 2b)(ii) Copy Paste
Before:Code:' 2b)(i) Relative formula referrences ... https://teylyn.com/2017/03/21/dollarsigns/#comment-191 ' Ws2.Cells.NumberFormat = "General" ' May be needed to prevent formulas coming out as test =[3.xlsx]Sheet1!$A$1 ' Let rngOut.Value = "='[3.xlsx]" & Ws3.Name & "'!A$1" ' Let rngOut.Value = rngOut.Value ' Change Formulas to values ' Let rngOut.Value = Evaluate("If({1},SUBSTITUTE(" & rngOut.Address & ", ""0"", """"))") ' https://excelribbon.tips.net/T010741_Removing_Spaces ' Or ' 2b)(ii) Copy Paste Dim rngIn As Range Set rngIn = Ws3.Range("A1:" & Lc3Ltr & "1") rngIn.Copy rngOut.PasteSpecial Paste:=xlPasteValues ' understanding Paste across ranges of different size to Copy range : https://excelfox.com/forum/showthread.php/2221-VBA-Range-Insert-Method-Code-line-makes-a-space-to-put-new-range-in?p=10441&viewfull=1#post10441
_____ Workbook: 3.xlsx ( Using Excel 2007 32 bit )
Worksheet: Sheet1
Row\Col A B C D E F G H I J K L 1NSE 6A GTT 2
_____ Workbook: 1.xls ( Using Excel 2007 32 bit )
Worksheet: 1-Sheet1 3Mai
Row\Col A B C D E F G H I J K L M 1Exchange Symbol Series/Expiry Open High Low Prev Close LTP 2NSE ACC EQ 1182 1193 1151.7 1190.45 1156.6 22 11.566 116815 1168.166 3NSE ADANIENT EQ 137.15 140.55 134.1 140.5 134.65 25 1.3465 13595 135.9965 4NSE ADANIPORTS EQ 273.95 276.95 269.55 277.6 270.65 15083 2.7065 27335 273.3565 5NSE ADANIPOWER EQ 32.3 32.35 30.45 32.45 30.65 17388 0.3065 3095 30.9565 6NSE AMARRAJA EQ 555 555 529.25 557.85 532.1 100 5.321 5374 537.21 7
_____ Workbook: 2.csv ( Using Excel 2007 32 bit )
Worksheet: 2
Row\Col A B C D E F G H I J 1 2 3
After running macro here : https://excelfox.com/forum/showthrea...ll=1#post13184
_____ Workbook: 2.csv ( Using Excel 2007 32 bit )
Worksheet: 2
Row\Col A B C D E F G H I J K L 1NSE 6A GTT 2NSE 6A GTT 3NSE 6A GTT 4NSE 6A GTT 5NSE 6A GTT 6
Alan
Share ‘1.xls’ : https://app.box.com/s/38aoip5xi7018y9syt0xe4g04u95l6xk
Share ‘macro.xlsm’ : https://app.box.com/s/599q2it3uck3hfwm5kscmmgtn0be66wt
Share ‘2.csv’ : https://app.box.com/s/sop0hl5slstjv38tr8wtvp7f7l39ep3k
Share ‘3.xlsx’ : https://app.box.com/s/8k9b556duom523b381m80oeixonp0042
Edit ... cross posted later once again!!!!
https://chandoo.org/forum/threads/copy-and-paste.44182/
https://excelfox.com/forum/showthrea...ll=1#post13439




Reply With Quote

Bookmarks