Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi all, Im working on a Rotseirn form were i allow the user to build there own roster Just by inserting a number into a Cell and clicking a button. Iv got most of the way But just need the last few Bits.
Basically i Use Dim Sets at the start of my Macro that copy a template range and Then runs a loop depending on what the user has input into the cell next to the button. I Have a Auto Fit command at the end of the Loop that fixes one of my problems But what i would Like is for the Macro to copy All the Cell Setting I.e Column Width+Height And Borders. and then to paste these in the Loop. What iv got so far is this: ================================================== ===== Sub Ne() Dim E As Variant Dim Name As Variant Dim Count As Integer Dim lastRow As Long Count = 0 Count2 = 3 E = Worksheets("Template").Range("$B$3:$AD$3").Formula Name = Worksheets("Sheet1").Range("$C$3") Sheets.Add.Name = Name Do Until Count = Worksheets("Sheet1").Range("$C$4") If Count = 1000 Then Exit Do Count = Count + 1 Count2 = Count2 + 1 Worksheets(Name).Cells(Count2, "A") = Count Worksheets(Name).Cells(Count2, "AE") = Count Worksheets(Name).Range(Cells(Count2, "B"), Cells(Count2, "AD")) = E Loop Worksheets(Name).Range("A:AE").Columns.AutoFit MsgBox ("The loop ran " & Count & " times.") End Sub ================================================== ======= Any Help Would Be much Appreciated. I Have tried Adding Another Dim As so and Making its Value As Below W = Worksheets("Template").Range("$B$3:$AD$3").Borders ().LineStyle Then Making the Cells W, To No Avail. Thanks for taking the time to look! Regards chris |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to COPY FORMULA BETWEEN RANGES | Excel Discussion (Misc queries) | |||
How do I copy formula but only increment certain ranges? | Excel Discussion (Misc queries) | |||
how copy formula that contains ranges so ranges do not overlap | Excel Worksheet Functions | |||
UserForm questions about text box propertys, thanks | Excel Programming | |||
How do I preset data to auto copy to a certain page | Excel Discussion (Misc queries) |