How to Make a Tartan Heart Image in Excel
Open a new Excel worksheet by opening the Excel application from the dock or Applications folder., Obtain the actual tartan and, probably with the aid of a magnifying glass, write down the color and number of the threads across in columns and do the...
Step-by-Step Guide
-
Step 1: Open a new Excel worksheet by opening the Excel application from the dock or Applications folder.
Set Preferences:
In General
- Set Use R1C1 reference style to checked or On.
Set column 1 to Format Column Width .5" and Format Row Height .25" Select Rows 2:200 and set Format Row Height to .06" (but see Tips).
Select Columns 2:512 and set Format Column Width to .03" (but see Tips).
Read through these steps and tips entirely before actually setting to work
-- there's a time-consuming route (given first) and an easier way (via making a copy of the given macro) that will save a lot of time and effort! But to create your own tartan's pattern, you must be familiar with the concepts conveyed in the first part, starting with this next step: -
Step 2: Obtain the actual tartan and
Be exact as you possibly can be, it's important in achieving the exact effect of really replicating the tartan, precisely.
Here's a picture of a tartan closeup which had its threads counted. , Select the column.
Make the color match the tartan's beginning thread color.
Use the Color Wheel.
Format Cells Fill the column (or to a designated row# stopping point) with the color., Use the Color Wheel.
Format Cells Fill the row (or to a designated column# stopping point) with the color., continuing over and under this way until you've filled the screen with the full image of the tartan! Be patient with yourself and do the job right, although it may take you hours, or even days to finish.
Working with the macros, however, takes much less time in the end., Then, whether you used the Grab app, or Paste Picture, do Command+v, copy.,,,,,,,,,, Well worth it, eh?, You use Advanced Editing to copy All the code to Word and do a Replace All of "#* " with nothing, and the code will result, which you can then paste into over a Visual Basic dummy macro you recorded that was meaningless.
Read on first, however.
Note:
In Sub Macro2(), at the end, there are some Directory path names in code lines which need to be changed to match your computer, please.
You can find out what these are by recording a macro to save a file into the folder where you plan to save the tartan work and tartan macro.
It is suggested that you make a text copy of any modifications you make to the macro and store them in a Word file to the same folder, for example if you modify the code to make a different tartan than the Anderson tartan.
Remember, you can always broaden the columns and row heights to get a better look at what's what in terms of thread count relative to the vertical looping down the rows in Sub Macro3(). , Then Developer will appear on your Ribbon and when you click on it, you'll see the Record icon button., Macro1 say, before its end, perhaps overwriting the dummy recorded code, type in Macro2.
That will call this Macro2 below, which you've copied in and pasted below Macro1.
You therefore can RUN either Macro2 or Macro1 and accomplish the same effect
-- completion of the tartan! Â :
D, The macro can take anywhere from
3.5 minutes to a half hour or more to run, depending on your processor (speed).
The code could have been written to run quicker but it would have been less easy to understand.
The line numbers are there to break up the code between different colors; a long section of code actually goes from what would be Line 841 to Line 870, typically.
There are shorter sections where there were only single or double threads (otherwise, looping was used, so the max loop value for the last X03 of 5 means that there are 5+2 = 7 rows or threads in the last weft section of black.
It is black because of Macro3 leaving the top cell of the 7 black.
The first two rows have every other cell pasted from this origin cell; after that, the entire done rows are copied and pasted below per the X03 loop, which is much quicker.
They are only done singly, however, as multiples would get confusing, given that the tartan is very inconsistent in how many threads per weft section there are, actually.
That said, the macro is so very much faster than doing it manually, there is just No Comparison!! , -
Step 3: probably with the aid of a magnifying glass
-
Step 4: write down the color and number of the threads across in columns and do the same down in rows.
-
Step 5: Begin in column 2.
-
Step 6: Then do row 2
-
Step 7: selecting the row
-
Step 8: and make the color match as closely as possible to the tartan's actual thread color.
-
Step 9: Then do column 3
-
Step 10: then row 3
-
Step 11: then column 4
-
Step 12: then row 4
-
Step 13: Use the Grab application or do Copy Picture by using the Shift Key with Edit Copy and then do Paste Picture to a new worksheet by using the Shift Key again.
-
Step 14: Open the application Preview and do File
-
Step 15: New from Clipboard.
-
Step 16: Export the file to the Desktop or into a new "Tartans XL Work" folder as a JPG file or PNG file format file and name the file "My XL Tartan Picture".
-
Step 17: Quit Preview.
-
Step 18: Click on Excel to activate it as the active application and choose the Media Tools icon along the very top of all the Tool Bars -- it has two tied piano notes in front and to the right of some images as its icon.
-
Step 19: Select from within the Media Tools window
-
Step 20: Shapes
-
Step 21: and select the Heart Shape
-
Step 22: or whatever shape you'd like your tartan to be within.
-
Step 23: Click on a blank portion of the Excel worksheet
-
Step 24: and a small heart (or the shape you've chosen) will appear.
-
Step 25: Re-size it as you prefer -- about 3" by 3" on the screen is probably about right.
-
Step 26: Do Format Shape Fill Picture and then choose the file
-
Step 27: My XL Tartan Picture.jpg
-
Step 28: to use as fill.
-
Step 29: Your image should resemble this one:
-
Step 30: Here is the macro code to create the tartan.
-
Step 31: OK. Before you can access the Visual Basic Editor
-
Step 32: you'll need to go to Excel Preferences and set the Ribbon to checked for Developer.
-
Step 33: When you record the dummy macro
-
Step 34: Sub Macro2() ' Macro2 Macro 'Anderson Tartan Columns - Left to right Application.ScreenUpdating = True Workbooks.Add Range("B:SQ").Select Selection.ColumnWidth = 1.5 Range("B1:O376").Select Range("B1:O376").Interior.Color = RGB(100
-
Step 35: 237) Range("P1:U376").Select Range("P1:U376").Interior.Color = RGB(0
-
Step 36: 0) Range("V1:AA376").Select Range("V1:AA376").Interior.Color = RGB(190
-
Step 37: 190) Range("AB1:AE376").Select Range("AB1:AE376").Interior.Color = RGB(0
-
Step 38: 0) Range("AF1:AI376").Select Range("AF1:AI376").Interior.Color = RGB(255
-
Step 39: 0) Range("AJ1:AM376").Select Range("AJ1:AM376").Interior.Color = RGB(0
-
Step 40: 0) Range("AN1:AQ376").Select Range("AN1:AQ376").Interior.Color = RGB(255
-
Step 41: 0) Range("AR1:AW376").Select Range("AR1:AW376").Interior.Color = RGB(0
-
Step 42: 0) Range("AX1:BA376").Select Range("AX1:BA376").Interior.Color = RGB(255
-
Step 43: 0) Range("BB1:BG376").Select Range("BB1:BG376").Interior.Color = RGB(0
-
Step 44: 255) Range("BH1:BI376").Select Range("BH1:BI376").Interior.Color = RGB(255
-
Step 45: 0) Range("BJ1:BQ376").Select Range("BJ1:BQ376").Interior.Color = RGB(46
-
Step 46: 87) Range("BR1:BT376").Select Range("BR1:BT376").Interior.Color = RGB(255
-
Step 47: 0) Range("BU1:CB376").Select Range("BU1:CB376").Interior.Color = RGB(46
-
Step 48: 87) Range("CC1:CF376").Select Range("CC1:CF376").Interior.Color = RGB(255
-
Step 49: 0) Range("CG1:CN376").Select Range("CG1:CN376").Interior.Color = RGB(46
-
Step 50: 87) Range("CO1:CR376").Select Range("CO1:CR376").Interior.Color = RGB(255
-
Step 51: 0) Range("CS1:CZ376").Select Range("CS1:CZ376").Interior.Color = RGB(46
-
Step 52: 87) Range("DA1:DB376").Select Range("DA1:DB376").Interior.Color = RGB(255
-
Step 53: 0) Range("DC1:DH376").Select Range("DC1:DH376").Interior.Color = RGB(0
-
Step 54: 255) Range("DI1:DL376").Select Range("DI1:DL376").Interior.Color = RGB(255
-
Step 55: 0) Range("DM1:DP376").Select Range("DM1:DP376").Interior.Color = RGB(0
-
Step 56: 0) Range("DQ1:DT376").Select Range("DQ1:DT376").Interior.Color = RGB(255
-
Step 57: 0) Range("DU1:DX376").Select Range("DU1:DX376").Interior.Color = RGB(0
-
Step 58: 0) Range("DY1:EB376").Select Range("DY1:EB376").Interior.Color = RGB(255
-
Step 59: 0) Range("EC1:EF376").Select Range("EC1:EF376").Interior.Color = RGB(0
-
Step 60: 0) Range("EG1:EL376").Select Range("EG1:EL376").Interior.Color = RGB(190
-
Step 61: 190) Range("EM1:ER376").Select Range("EM1:ER376").Interior.Color = RGB(0
-
Step 62: 0) Range("ES1:FF376").Select Range("ES1:FF376").Interior.Color = RGB(100
-
Step 63: 237) Range("FG1:FG376").Select Range("FG1:FG376").Interior.Color = RGB(255
-
Step 64: 0) Range("FH1:FK376").Select Range("FH1:FK376").Interior.Color = RGB(0
-
Step 65: 0) Range("FL1:FL376").Select Range("FL1:FL376").Interior.Color = RGB(255
-
Step 66: 0) Range("FM1:FR376").Select Range("FM1:FR376").Interior.Color = RGB(100
-
Step 67: 237) Range("FS1:FX376").Select Range("FS1:FX376").Interior.Color = RGB(255
-
Step 68: 0) Range("FY1:GD376").Select Range("FY1:GD376").Interior.Color = RGB(100
-
Step 69: 237) Range("GE1:GE376").Select Range("GE1:GE376").Interior.Color = RGB(255
-
Step 70: 0) Range("GF1:GI376").Select Range("GF1:GI376").Interior.Color = RGB(0
-
Step 71: 0) Range("GJ1:GJ376").Select Range("GJ1:GJ376").Interior.Color = RGB(255
-
Step 72: 0) Range("GK1:GX376").Select Range("GK1:GX376").Interior.Color = RGB(100
-
Step 73: 237) Range("GY1:HB376").Select Range("GY1:HB376").Interior.Color = RGB(0
-
Step 74: 0) Range("HC1:HH376").Select Range("HC1:HH376").Interior.Color = RGB(190
-
Step 75: 190) Range("HI1:HL376").Select Range("HI1:HL376").Interior.Color = RGB(0
-
Step 76: 0) Range("HM1:HP376").Select Range("HM1:HP376").Interior.Color = RGB(255
-
Step 77: 0) Range("HQ1:HT376").Select Range("HQ1:HT376").Interior.Color = RGB(0
-
Step 78: 0) Range("HU1:HX376").Select Range("HU1:HX376").Interior.Color = RGB(255
-
Step 79: 0) Range("HY1:ID376").Select Range("HY1:ID376").Interior.Color = RGB(0
-
Step 80: 0) Range("IE1:IH376").Select Range("IE1:IH376").Interior.Color = RGB(255
-
Step 81: 0) Range("II1:IN376").Select Range("II1:IN376").Interior.Color = RGB(0
-
Step 82: 255) Range("IO1:IP376").Select Range("IO1:IP376").Interior.Color = RGB(255
-
Step 83: 0) Range("IQ1:IV376").Select Range("IQ1:IV376").Interior.Color = RGB(46
-
Step 84: 87) Range("IW1:JJ376").Select Range("IW1:JJ376").Interior.Color = RGB(100
-
Step 85: 237) Range("JK1:JP376").Select Range("JK1:JP376").Interior.Color = RGB(0
-
Step 86: 0) Range("JQ1:JV376").Select Range("JQ1:JV376").Interior.Color = RGB(190
-
Step 87: 190) Range("JW1:JZ376").Select Range("JW1:JZ376").Interior.Color = RGB(0
-
Step 88: 0) Range("KA1:KD376").Select Range("KA1:KD376").Interior.Color = RGB(255
-
Step 89: 0) Range("KE1:KH376").Select Range("KE1:KH376").Interior.Color = RGB(0
-
Step 90: 0) Range("KI1:KL376").Select Range("KI1:KL376").Interior.Color = RGB(255
-
Step 91: 0) Range("KM1:KR376").Select Range("KM1:KR376").Interior.Color = RGB(0
-
Step 92: 0) Range("KS1:KV376").Select Range("KS1:KV376").Interior.Color = RGB(255
-
Step 93: 0) Range("KW1:LB376").Select Range("KW1:LB376").Interior.Color = RGB(0
-
Step 94: 255) Range("LC1:LD376").Select Range("LC1:LD376").Interior.Color = RGB(255
-
Step 95: 0) Range("LE1:LL376").Select Range("LE1:LL376").Interior.Color = RGB(46
-
Step 96: 87) Range("LM1:LO376").Select Range("LM1:LO376").Interior.Color = RGB(255
-
Step 97: 0) Range("LP1:LW376").Select Range("LP1:LW376").Interior.Color = RGB(46
-
Step 98: 87) Range("LX1:MA376").Select Range("LX1:MA376").Interior.Color = RGB(255
-
Step 99: 0) Range("MB1:MI376").Select Range("MB1:MI376").Interior.Color = RGB(46
-
Step 100: 87) Range("MJ1:MM376").Select Range("MJ1:MM376").Interior.Color = RGB(255
-
Step 101: 0) Range("MN1:MU376").Select Range("MN1:MU376").Interior.Color = RGB(46
-
Step 102: 87) Range("MV1:MW376").Select Range("MV1:MW376").Interior.Color = RGB(255
-
Step 103: 0) Range("MX1:NC376").Select Range("MX1:NC376").Interior.Color = RGB(0
-
Step 104: 255) Range("ND1:NG376").Select Range("ND1:NG376").Interior.Color = RGB(255
-
Step 105: 0) Range("NH1:NK376").Select Range("NH1:NK376").Interior.Color = RGB(0
-
Step 106: 0) Range("NL1:NO376").Select Range("NL1:NO376").Interior.Color = RGB(255
-
Step 107: 0) Range("NP1:NS376").Select Range("NP1:NS376").Interior.Color = RGB(0
-
Step 108: 0) Range("NT1:NW376").Select Range("NT1:NW376").Interior.Color = RGB(255
-
Step 109: 0) Range("NX1:OA376").Select Range("NX1:OA376").Interior.Color = RGB(0
-
Step 110: 0) Range("OB1:OG376").Select Range("OB1:OG376").Interior.Color = RGB(190
-
Step 111: 190) Range("OH1:OM376").Select Range("OH1:OM376").Interior.Color = RGB(0
-
Step 112: 0) Range("ON1:PA376").Select Range("ON1:PA376").Interior.Color = RGB(100
-
Step 113: 237) Range("PB1:PB376").Select Range("PB1:PB376").Interior.Color = RGB(255
-
Step 114: 0) Range("PC1:PF376").Select Range("PC1:PF376").Interior.Color = RGB(0
-
Step 115: 0) Range("PG1:PG376").Select Range("PG1:PG376").Interior.Color = RGB(255
-
Step 116: 0) Range("PH1:PM376").Select Range("PH1:PM376").Interior.Color = RGB(100
-
Step 117: 237) Range("PN1:PS376").Select Range("PN1:PS376").Interior.Color = RGB(255
-
Step 118: 0) Range("PT1:PY376").Select Range("PT1:PY376").Interior.Color = RGB(100
-
Step 119: 237) Range("PZ1:PZ376").Select Range("PZ1:PZ376").Interior.Color = RGB(255
-
Step 120: 0) Range("QA1:QD376").Select Range("QA1:QD376").Interior.Color = RGB(0
-
Step 121: 0) Range("QE1:QE376").Select Range("QE1:QE376").Interior.Color = RGB(255
-
Step 122: 0) Range("QF1:QS376").Select Range("QF1:QS376").Interior.Color = RGB(100
-
Step 123: 237) Range("QT1:QW376").Select Range("QT1:QW376").Interior.Color = RGB(0
-
Step 124: 0) Range("QX1:RC376").Select Range("QX1:RC376").Interior.Color = RGB(190
-
Step 125: 190) Range("RD1:RG376").Select Range("RD1:RG376").Interior.Color = RGB(0
-
Step 126: 0) Range("RH1:RK376").Select Range("RH1:RK376").Interior.Color = RGB(255
-
Step 127: 0) Range("RL1:RO376").Select Range("RL1:RO376").Interior.Color = RGB(0
-
Step 128: 0) Range("RP1:RS376").Select Range("RP1:RS376").Interior.Color = RGB(255
-
Step 129: 0) Range("RT1:RY376").Select Range("RT1:RY376").Interior.Color = RGB(0
-
Step 130: 0) Range("RZ1:SC376").Select Range("RZ1:SC376").Interior.Color = RGB(255
-
Step 131: 0) Range("SD1:SI376").Select Range("SD1:SI376").Interior.Color = RGB(0
-
Step 132: 255) Range("SJ1:SK376").Select Range("SJ1:SK376").Interior.Color = RGB(255
-
Step 133: 0) Range("SL1:SQ376").Select Range("SL1:SQ376").Interior.Color = RGB(46
-
Step 134: 87) ChDir _ "Macintosh HD:Users:chrisgarthwaite:Documents:Excel Æ’: Hubs and SITES:LifeGuide Hub's:" Range("SL1:SQ376").Select ActiveWorkbook.SaveAs Filename:= _ "Macintosh HD:Users:chrisgarthwaite:Documents:Excel Æ’:Tartan Work: Anderson Tartan Development.xlsx" _
-
Step 135: FileFormat:=xlOpenXMLWorkbook
-
Step 136: CreateBackup:=False Macro1_Vertical_Row_Sampler End Sub Sub Macro1_Vertical_Row_Sampler() ' ' Macro1_Vertical_Row_Sampler Macro ' Vertical Row Sampler ' Top to bottom Range("A2").Select ActiveWorkbook.Names.Add Name:="Tartan_Vertical_StarterCell"
-
Step 137: RefersToR1C1 _ Â :="=Sheet1!R2C1" Range("A1:A210").Select Selection.RowHeight = 18 Range("A2:A10").Select Range("A2").Interior.Color = RGB(0
-
Step 138: 0) Range("A11:A16").Select Range("A11").Interior.Color = RGB(255
-
Step 139: 0) Range("A17:A23").Select Range("A17").Interior.Color = RGB(0
-
Step 140: 0) Range("A24:A29").Select Range("A24").Interior.Color = RGB(255
-
Step 141: 0) Range("A30:A36").Select Range("A30").Interior.Color = RGB(0
-
Step 142: 0) Range("A37:A38").Select Range("A37").Interior.Color = RGB(255
-
Step 143: 0) Range("A39:A42").Select Range("A39").Interior.Color = RGB(0
-
Step 144: 255) Range("A43:A44").Select Range("A43").Interior.Color = RGB(255
-
Step 145: 0) Range("A45:A48").Select Range("A45").Interior.Color = RGB(0
-
Step 146: 0) Range("A49").Select Range("A49").Interior.Color = RGB(255
-
Step 147: 0) Range("A50").Select Range("A50").Interior.Color = RGB(0
-
Step 148: 0) Range("A51").Select Range("A51").Interior.Color = RGB(255
-
Step 149: 0) Range("A52:A55").Select Range("A52").Interior.Color = RGB(0
-
Step 150: 0) Range("A56:A59").Select Range("A56").Interior.Color = RGB(224
-
Step 151: 255) Range("A60:A65").Select Range("A60").Interior.Color = RGB(0
-
Step 152: 0) Range("A66:A85").Select Range("A66").Interior.Color = RGB(0
-
Step 153: 255) Range("A86:A87").Select Range("A86").Interior.Color = RGB(255
-
Step 154: 0) Range("A88:A91").Select Range("A88").Interior.Color = RGB(0
-
Step 155: 0) Range("A92:A93").Select Range("A92").Interior.Color = RGB(255
-
Step 156: 0) Range("A94:A101").Select Range("A94").Interior.Color = RGB(0
-
Step 157: 255) Range("A102:A107").Select Range("A102").Interior.Color = RGB(255
-
Step 158: 0) Range("A108:A115").Select Range("A108").Interior.Color = RGB(0
-
Step 159: 255) Range("A116:A117").Select Range("A116").Interior.Color = RGB(255
-
Step 160: 0) Range("A118:A121").Select Range("A118").Interior.Color = RGB(0
-
Step 161: 0) Range("A122:A123").Select Range("A122").Interior.Color = RGB(255
-
Step 162: 0) Range("A124:A143").Select Range("A124").Interior.Color = RGB(0
-
Step 163: 255) Range("A144:A149").Select Range("A144").Interior.Color = RGB(0
-
Step 164: 0) Range("A150:A153").Select Range("A150").Interior.Color = RGB(224
-
Step 165: 255) Range("A154:A157").Select Range("A154").Interior.Color = RGB(0
-
Step 166: 0) Range("A158").Select Range("A158").Interior.Color = RGB(255
-
Step 167: 0) Range("A159").Select Range("A159").Interior.Color = RGB(0
-
Step 168: 0) Range("A160").Select Range("A160").Interior.Color = RGB(255
-
Step 169: 0) Range("A161:A164").Select Range("A161").Interior.Color = RGB(0
-
Step 170: 0) Range("A165:A166").Select Range("A165").Interior.Color = RGB(255
-
Step 171: 0) Range("A167:A170").Select Range("A167").Interior.Color = RGB(0
-
Step 172: 255) Range("A171:A172").Select Range("A171").Interior.Color = RGB(255
-
Step 173: 0) Range("A173:A179").Select Range("A173").Interior.Color = RGB(0
-
Step 174: 0) Range("A180:A185").Select Range("A180").Interior.Color = RGB(255
-
Step 175: 0) Range("A186:A192").Select Range("A186").Interior.Color = RGB(0
-
Step 176: 0) Range("A193:A198").Select Range("A193").Interior.Color = RGB(255
-
Step 177: 0) Range("A199:A205").Select Range("A199").Interior.Color = RGB(0
-
Step 178: 0) Range("A206").Select ActiveCell.FormulaR1C1 = "End" ActiveWorkbook.Save Application.ScreenUpdating = False Macro3 End Sub Sub Macro3() ' Macro3 Macro Windows(" Anderson Tartan Development.xlsx").Activate Application.Goto Reference:="Tartan_Vertical_StarterCell" 'Make the first 9 rows black Macro6 For X03 = 1 To 7 Macro8 Next 10 Application.CutCopyMode = False 'Make the next 6 rows red Macro7 For X03 = 1 To 4 Macro8 Next 30 Application.CutCopyMode = False 'Make the next 7 rows black Macro7 For X03 = 1 To 5 Macro8 Next 50 Application.CutCopyMode = False 'Make the next 6 rows red Macro6 For X03 = 1 To 4 Macro8 Next 70 Application.CutCopyMode = False 'Make the next 7 rows black Macro6 For X03 = 1 To 5 Macro8 Next 90 Application.CutCopyMode = False 'Make the next 2 rows red Macro6 100 Application.CutCopyMode = False 'Make the next 4 rows blue-purple� Macro6 For X03 = 1 To 2 Macro8 Next 130 Application.CutCopyMode = False 'Make the next 2 rows red Macro6 140 Application.CutCopyMode = False 'Make the next 4 rows black Macro6 For X03 = 1 To 2 Macro8 Next 170 Application.CutCopyMode = False 'Make the next SINGLE ROW yellow Selection.Copy ActiveCell.Offset(0
-
Step 179: 1).Select ActiveSheet.Paste 180 For X01 = 1 To 255 ActiveCell.Offset(0
-
Step 180: 2).Select ActiveSheet.Paste Next ActiveCell.Offset(1
-
Step 181: -511).Select 190 Application.CutCopyMode = False 'Make the next SINGLE ROW black Selection.Copy ActiveCell.Offset(0
-
Step 182: 2).Select ActiveSheet.Paste 200 For X01 = 1 To 255 ActiveCell.Offset(0
-
Step 183: 2).Select ActiveSheet.Paste Next ActiveCell.Offset(1
-
Step 184: -512).Select 210 Application.CutCopyMode = False 'Make the next SINGLE ROW yellow Selection.Copy ActiveCell.Offset(0
-
Step 185: 1).Select ActiveSheet.Paste 220 For X01 = 1 To 255 ActiveCell.Offset(0
-
Step 186: 2).Select ActiveSheet.Paste Next ActiveCell.Offset(1
-
Step 187: -511).Select 230 Application.CutCopyMode = False 'Make the next 4 rows black Macro6 For X03 = 1 To 2 Macro8 Next 270 Application.CutCopyMode = False 'Make the next 4 rows white Macro7 For X03 = 1 To 2 Macro8 Next 280 Application.CutCopyMode = False 'Make the next 6 rows black Macro6 For X03 = 1 To 4 Macro8 Next 290 Application.CutCopyMode = False 'Make the next 20 rows blue-green Macro6 For X03 = 1 To 18 Macro8 Next 310 Application.CutCopyMode = False 'Make the next 2 rows red Macro6 320 Application.CutCopyMode = False 'Make the next 4 rows black Macro6 For X03 = 1 To 2 Macro8 Next 350 Application.CutCopyMode = False 'Make the next 2 rows red Macro6 360 Application.CutCopyMode = False 'Make the next 8 rows blue-green Macro6 For X03 = 1 To 6 Macro8 Next 410 Application.CutCopyMode = False 'Make the next 6 rows red Macro6 For X03 = 1 To 4 Macro8 Next 430 Application.CutCopyMode = False Macro6 For X03 = 1 To 6 Macro8 Next 450 Application.CutCopyMode = False 'Make the next 2 rows red Macro6 470 Application.CutCopyMode = False 'Make the next 4 rows black Macro6 For X03 = 1 To 2 Macro8 Next 490 Application.CutCopyMode = False 'Make the next 2 rows red Macro6 500 Application.CutCopyMode = False 'Make the next 20 rows blue-green Macro6 For X03 = 1 To 18 Macro8 Next 530 Application.CutCopyMode = False 'Make the next 6 rows black Macro6 For X03 = 1 To 4 Macro8 Next 550 Application.CutCopyMode = False 'Make the next 4 rows white Macro6 For X03 = 1 To 2 Macro8 Next 570 Application.CutCopyMode = False 'Make the next 4 rows black Macro6 For X03 = 1 To 2 Macro8 Next 590 Application.CutCopyMode = False 'Make the next SINGLE ROW yellow Selection.Copy 600 For X01 = 1 To 255 ActiveCell.Offset(0
-
Step 188: 2).Select ActiveSheet.Paste Next ActiveCell.Offset(1
-
Step 189: -510).Select 610 Application.CutCopyMode = False 'Make the next SINGLE ROW black Selection.Copy ActiveCell.Offset(0
-
Step 190: 1).Select ActiveSheet.Paste 620 For X01 = 1 To 255 ActiveCell.Offset(0
-
Step 191: 2).Select ActiveSheet.Paste Next ActiveCell.Offset(1
-
Step 192: -511).Select 630 Application.CutCopyMode = False 'Make the next SINGLE ROW yellow Selection.Copy 640 For X01 = 1 To 255 ActiveCell.Offset(0
-
Step 193: 2).Select ActiveSheet.Paste Next ActiveCell.Offset(1
-
Step 194: -510).Select 650 Application.CutCopyMode = False 'Make the next 4 rows black Macro7 For X03 = 1 To 2 Macro8 Next 670 Application.CutCopyMode = False 'Make the next 2 rows red Macro6 690 Application.CutCopyMode = False 'Make the next 4 rows blue-purple Macro7 For X03 = 1 To 2 Macro8 Next 740 Application.CutCopyMode = False 'Make the next 2 rows red Macro6 750 Application.CutCopyMode = False 'Make the next 7 rows black Macro7 For X03 = 1 To 5 Macro8 Next 780 Application.CutCopyMode = False 'Make the next 6 rows red Macro6 For X03 = 1 To 4 Macro8 Next 800 Application.CutCopyMode = False 'Make the next 7 rows black Macro6 For X03 = 1 To 5 Macro8 Next 820 Application.CutCopyMode = False 'Make the next 6 rows red Macro7 For X03 = 1 To 4 Macro8 Next 840 Application.CutCopyMode = False 'Make the next (the last) 7 rows black Macro7 For X03 = 1 To 5 Macro8 Next 870 Application.CutCopyMode = False Columns("B:SQ").Select Range("B178").Activate Selection.ColumnWidth = 0.18 Rows("2:205").Select Range("A205").Activate Selection.RowHeight = 4 Macro11 ActiveWorkbook.SaveAs Filename:= _ "Macintosh HD:Users:chrisgarthwaite:Documents:Excel Æ’:Tartan Work: Anderson Tartan Development.xlsm" _
-
Step 195: FileFormat:=xlOpenXMLWorkbookMacroEnabled
-
Step 196: CreateBackup:=False End Sub Sub Macro6() ' Macro6 Macro Selection.Copy 0 For X01 = 1 To 255 ActiveCell.Offset(0
-
Step 197: 2).Select ActiveSheet.Paste Next ActiveCell.Offset(1
-
Step 198: -510).Select ActiveSheet.Paste ActiveCell.Offset(0
-
Step 199: 1).Select ActiveSheet.Paste For X02 = 1 To 255 ActiveCell.Offset(0
-
Step 200: 2).Select ActiveSheet.Paste Next ActiveCell.Offset(1
-
Step 201: -511).Select End Sub Sub Macro7() ' Macro7 Macro Selection.Copy ActiveCell.Offset(0
-
Step 202: 1).Select ActiveSheet.Paste 20 For X01 = 1 To 255 ActiveCell.Offset(0
-
Step 203: 2).Select ActiveSheet.Paste Next ActiveCell.Offset(1
-
Step 204: -511).Select ActiveSheet.Paste For X02 = 1 To 255 ActiveCell.Offset(0
-
Step 205: 2).Select ActiveSheet.Paste Next ActiveCell.Offset(1
-
Step 206: -510).Select ActiveSheet.Paste End Sub Sub Macro8() ' Macro8 Macro ActiveCell.Offset(-2
-
Step 207: 510).Select ActiveWorkbook.Names.Add Name:="RightEnd"
-
Step 208: RefersToR1C1:=ActiveCell ActiveCell.Offset(2
-
Step 209: -510).Select ActiveCell.Offset(-2
-
Step 210: 0).Select ActiveWorkbook.Names.Add Name:="LeftEnd"
-
Step 211: RefersToR1C1:=ActiveCell Application.Goto Reference:="LeftEnd: RightEnd" Selection.Copy ActiveCell.Offset(2
-
Step 212: 0).Select ActiveSheet.Paste ActiveCell.Offset(1
-
Step 213: 0).Select ActiveWorkbook.Save End Sub Sub Macro11() ' Macro11 Macro Columns("A:A").Select Selection.Copy Columns("SR:SR").Select ActiveSheet.Paste Columns("SS:SS").Select Application.CutCopyMode = False Selection.Delete Shift:=xlToLeft Range("A1").Select End Sub Be patient
-
Step 214: please.
-
Step 215: Final image:
Detailed Guide
Set Preferences:
In General
- Set Use R1C1 reference style to checked or On.
Set column 1 to Format Column Width .5" and Format Row Height .25" Select Rows 2:200 and set Format Row Height to .06" (but see Tips).
Select Columns 2:512 and set Format Column Width to .03" (but see Tips).
Read through these steps and tips entirely before actually setting to work
-- there's a time-consuming route (given first) and an easier way (via making a copy of the given macro) that will save a lot of time and effort! But to create your own tartan's pattern, you must be familiar with the concepts conveyed in the first part, starting with this next step:
Be exact as you possibly can be, it's important in achieving the exact effect of really replicating the tartan, precisely.
Here's a picture of a tartan closeup which had its threads counted. , Select the column.
Make the color match the tartan's beginning thread color.
Use the Color Wheel.
Format Cells Fill the column (or to a designated row# stopping point) with the color., Use the Color Wheel.
Format Cells Fill the row (or to a designated column# stopping point) with the color., continuing over and under this way until you've filled the screen with the full image of the tartan! Be patient with yourself and do the job right, although it may take you hours, or even days to finish.
Working with the macros, however, takes much less time in the end., Then, whether you used the Grab app, or Paste Picture, do Command+v, copy.,,,,,,,,,, Well worth it, eh?, You use Advanced Editing to copy All the code to Word and do a Replace All of "#* " with nothing, and the code will result, which you can then paste into over a Visual Basic dummy macro you recorded that was meaningless.
Read on first, however.
Note:
In Sub Macro2(), at the end, there are some Directory path names in code lines which need to be changed to match your computer, please.
You can find out what these are by recording a macro to save a file into the folder where you plan to save the tartan work and tartan macro.
It is suggested that you make a text copy of any modifications you make to the macro and store them in a Word file to the same folder, for example if you modify the code to make a different tartan than the Anderson tartan.
Remember, you can always broaden the columns and row heights to get a better look at what's what in terms of thread count relative to the vertical looping down the rows in Sub Macro3(). , Then Developer will appear on your Ribbon and when you click on it, you'll see the Record icon button., Macro1 say, before its end, perhaps overwriting the dummy recorded code, type in Macro2.
That will call this Macro2 below, which you've copied in and pasted below Macro1.
You therefore can RUN either Macro2 or Macro1 and accomplish the same effect
-- completion of the tartan! Â :
D, The macro can take anywhere from
3.5 minutes to a half hour or more to run, depending on your processor (speed).
The code could have been written to run quicker but it would have been less easy to understand.
The line numbers are there to break up the code between different colors; a long section of code actually goes from what would be Line 841 to Line 870, typically.
There are shorter sections where there were only single or double threads (otherwise, looping was used, so the max loop value for the last X03 of 5 means that there are 5+2 = 7 rows or threads in the last weft section of black.
It is black because of Macro3 leaving the top cell of the 7 black.
The first two rows have every other cell pasted from this origin cell; after that, the entire done rows are copied and pasted below per the X03 loop, which is much quicker.
They are only done singly, however, as multiples would get confusing, given that the tartan is very inconsistent in how many threads per weft section there are, actually.
That said, the macro is so very much faster than doing it manually, there is just No Comparison!! ,
About the Author
Debra Wells
Brings years of experience writing about DIY projects and related subjects.
Rate This Guide
How helpful was this guide? Click to rate: