Home

Macros and Programming

 

CardboxForumsMacros and Programming > "Macro to use a cell value to know how many rolls to copy from another worksheet"

Macro to use a cell value to know how many rolls to copy from another worksheet

Macro to use a cell value to know how many rolls to copy from another worksheet

Current user: [none]
Register / Log In · Help

Posted By Post

cajunman64

27-Dec-2015 01:23

I have a macro that will copy a set range of cells from the workbook from "Formulas" worksheet and will create a new Workbook/worksheet and paste the set range of cells that was copied from the "Formulas" worksheet.

Sub CreateFile()
Dim ws As Worksheet, strFile As String

Sheets("Formulas").Range("A1:AD7202").Copy
    'Start Excel And let it recieve focus
    Workbooks.Add
    'Send the keys CTRL+V To Excel (i.e the window that has focus)
     Sheets("Sheet1").Select
    Range("A1").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _:=False, Transpose:=False
    Columns("A:A").Select
    Selection.NumberFormat = "m/d/yyyy"
    Columns("B:B").Select
    Selection.NumberFormat = "h:mm:ss;@"
    Range("A1").Select
    Application.Dialogs(xlDialogSaveAs).Show ""
End Sub

Need help with make the above macro to first look into the first sheet name "Start Here" and get value from I8 and then use this value to copy a range of rolls from the last Sheet name "Formulas" from the same workbook then create the new workbook / worksheet and paste the values into it

Cell I8 has a value of 7202; thats how may rolls has data...note this value will change depending on what data was pasted into the other worksheets (PEN1, PEN2 and so on)

bert

27-Dec-2015 10:27

cajunman64, please find an Excel forum!

Quick Reply

Please log in or register before trying to post a reply.

 
© 2010 Cardbox Software Limited   Home