sassora
04-09-2008, 07:45 AM
I have some code that seems to do what I want but the formulas in the sheet are all #NAME?
The ideas is that they do : a1, a2, a3 ... and b1, b2, b3 ... etc
Sheets("Maintable_Data").Select
Dim Lastrow As Long
Dim Lastcolumn As Long
Lastrow = Cells(65356, 1).End(xlUp).Row 'Finds last row (in column A)
Lastcolumn = Cells(1, 256).End(xlToLeft).Column 'Finds last column (in row A)
Sheets("Maintable_Edit").Select
ClearColumns 'Just a macro that clears everything in the spreadsheet
Range("A1").Select
ActiveCell.FormulaR1C1 = "=Maintable_Data!A1"
Range("A1").Select
Selection.AutoFill Destination:=Range(Cells(1, 1), Cells(1, Lastcolumn)), Type:=xlFillDefault
Range(Cells(1, 1), Cells(1, Lastcolumn)).Select
Selection.AutoFill Destination:=Range(Cells(1, 1), Cells(Lastrow, Lastcolumn)), Type:=xlFillDefault
Range(Cells(1, 1), Cells(Lastrow, Lastcolumn)).Select
EDIT: Actually the formuls are are coming up as A1, which isn't too good
The ideas is that they do : a1, a2, a3 ... and b1, b2, b3 ... etc
Sheets("Maintable_Data").Select
Dim Lastrow As Long
Dim Lastcolumn As Long
Lastrow = Cells(65356, 1).End(xlUp).Row 'Finds last row (in column A)
Lastcolumn = Cells(1, 256).End(xlToLeft).Column 'Finds last column (in row A)
Sheets("Maintable_Edit").Select
ClearColumns 'Just a macro that clears everything in the spreadsheet
Range("A1").Select
ActiveCell.FormulaR1C1 = "=Maintable_Data!A1"
Range("A1").Select
Selection.AutoFill Destination:=Range(Cells(1, 1), Cells(1, Lastcolumn)), Type:=xlFillDefault
Range(Cells(1, 1), Cells(1, Lastcolumn)).Select
Selection.AutoFill Destination:=Range(Cells(1, 1), Cells(Lastrow, Lastcolumn)), Type:=xlFillDefault
Range(Cells(1, 1), Cells(Lastrow, Lastcolumn)).Select
EDIT: Actually the formuls are are coming up as A1, which isn't too good