+ Reply to Thread
Results 1 to 3 of 3

copy files code (improvement needed )

  1. #1
    Registered User
    Join Date
    08-08-2008
    Location
    Dresden
    Posts
    68

    copy files code (improvement needed )

    Hello All,

    I have been able to assemble a code to copy data from Sheet5 of different workbooks to a new workbook. I know the code is rudimentary but good for novice like me

    I have to format the cells in the new workbook after copying the data for ex: make font bold. make left border thick, make both up and down border thick. It depends on the particular cell.

    Can someone please tell me by what statement can I select the cell of the new workbook and then using With Selection change font/border etc.

    I am not able to select the cells in the new workbook using Activecell command after I paste the data using statement
    :: wSheet.Range("A1").Copy Destination:=ToSheet.Cells(r, c)


    The full code goes like this: (I have kept it shorter for 5 cells only original is for 23 cells)

    Please Login or Register  to view this content.
    Thank you in advance
    arora

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Why copy individual cells?

    If you use With wSheet then you don't need wSheet.Range, only .Range. Something like
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    08-08-2008
    Location
    Dresden
    Posts
    68

    Thank you

    Hello RoyUK

    Thank you for your reply,

    Your code is perfect ... basically I copied indiviual cells because the data to be copied on first cell has to be made Bold and then other cells have a color and also different cells have different border thicknesses.

    I hav attached the file here and from column D onwards I enter the data.

    Can you please suggest someway of selecting the cell to which data is copied and then changing its format. the number of columns in this file is 10 but they vary always.

    I want to enter data in a cell, select it and then change its format ..

    Thank you
    arora
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. code required to copy and paste rows matching a criteria.
    By Duguid1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-30-2008, 04:49 AM
  2. Using VBA to copy and paste the content of multiple worksheets to a new files
    By rugbyfitz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-17-2008, 08:22 AM
  3. Code to open a workbook , copy info and return it to another workbook using a cell v.
    By england79m in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2008, 11:22 AM
  4. Modifing code to attach files to email
    By jat82nd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-20-2007, 01:41 PM
  5. create separate files from master
    By izza56 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-15-2007, 05:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1