How to Make a Tartan Heart Image in Excel

You will learn to make an image consisting of a heart, filled with a colorful Scottish tartan of your choice, or any woven fabric that is a simple over and under weave. Once you have the larger background rectangular tartan pattern, you...

Part 1 of 4:

Preparation

  1. Open a new Excel worksheet by opening the Excel application from the dock or Applications folder.
    1. Set Preferences: In General - Set Use R1C1 reference style to checked or On.
    2. Set column 1 to Format Column Width .5" and Format Row Height .25"
    3. Select Rows 2:200 and set Format Row Height to .06" (but see Tips).
    4. Select Columns 2:512 and set Format Column Width to .03" (but see Tips).
    5. 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:
  2. Picture 1 of How to Make a Tartan Heart Image in Excel
    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 same down in rows. 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.
Part 2 of 4:

Create the Onscreen Tartan Pattern

  1. Begin in column 2. 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.
  2. Then do row 2, selecting the row, and make the color match as closely as possible to the tartan's actual thread color. Use the Color Wheel. Format Cells Fill the row (or to a designated column# stopping point) with the color.
  3. Then do column 3, then row 3, then column 4, then row 4, etc., etc. 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.
Part 3 of 4:

Create the Shape-Filled Pattern

  1. 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. Then, whether you used the Grab app, or Paste Picture, do Command+v, copy.
  2. Open the application Preview and do File, New from Clipboard.
  3. 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".
  4. Quit Preview.
  5. 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.
  6. Select from within the Media Tools window, Shapes, and select the Heart Shape, or whatever shape you'd like your tartan to be within.
  7. Click on a blank portion of the Excel worksheet, and a small heart (or the shape you've chosen) will appear.
  8. Re-size it as you prefer -- about 3" by 3" on the screen is probably about right.
  9. Do Format Shape Fill Picture and then choose the file, My XL Tartan Picture.jpg, to use as fill.
  10. Picture 2 of How to Make a Tartan Heart Image in Excel
    Your image should resemble this one:
  11. Done! Well worth it, eh?
  12. Here is the macro code to create the tartan. 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.
    1. 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.
    2. 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.
    3. 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().
  13. OK. Before you can access the Visual Basic Editor, you'll need to go to Excel Preferences and set the Ribbon to checked for Developer. Then Developer will appear on your Ribbon and when you click on it, you'll see the Record icon button.
  14. When you record the dummy macro, e.g. 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
Part 4 of 4:

The Tartan Macro Code

    1. Sub Macro2()
    2. ' Macro2 Macro
    3. 'Anderson Tartan Columns - Left to right
    4. Application.ScreenUpdating = True
    5. Workbooks.Add
    6. Range("B:SQ").Select
    7. Selection.ColumnWidth = 1.5
    8. Range("B1:O376").Select
    9. Range("B1:O376").Interior.Color = RGB(100, 149, 237)
    10. Range("P1:U376").Select
    11. Range("P1:U376").Interior.Color = RGB(0, 0, 0)
    12. Range("V1:AA376").Select
    13. Range("V1:AA376").Interior.Color = RGB(190, 190, 190)
    14. Range("AB1:AE376").Select
    15. Range("AB1:AE376").Interior.Color = RGB(0, 0, 0)
    16. Range("AF1:AI376").Select
    17. Range("AF1:AI376").Interior.Color = RGB(255, 255, 0)
    18. Range("AJ1:AM376").Select
    19. Range("AJ1:AM376").Interior.Color = RGB(0, 0, 0)
    20. Range("AN1:AQ376").Select
    21. Range("AN1:AQ376").Interior.Color = RGB(255, 255, 0)
    22. Range("AR1:AW376").Select
    23. Range("AR1:AW376").Interior.Color = RGB(0, 0, 0)
    24. Range("AX1:BA376").Select
    25. Range("AX1:BA376").Interior.Color = RGB(255, 0, 0)
    26. Range("BB1:BG376").Select
    27. Range("BB1:BG376").Interior.Color = RGB(0, 0, 255)
    28. Range("BH1:BI376").Select
    29. Range("BH1:BI376").Interior.Color = RGB(255, 0, 0)
    30. Range("BJ1:BQ376").Select
    31. Range("BJ1:BQ376").Interior.Color = RGB(46, 139, 87)
    32. Range("BR1:BT376").Select
    33. Range("BR1:BT376").Interior.Color = RGB(255, 0, 0)
    34. Range("BU1:CB376").Select
    35. Range("BU1:CB376").Interior.Color = RGB(46, 139, 87)
    36. Range("CC1:CF376").Select
    37. Range("CC1:CF376").Interior.Color = RGB(255, 0, 0)
    38. Range("CG1:CN376").Select
    39. Range("CG1:CN376").Interior.Color = RGB(46, 139, 87)
    40. Range("CO1:CR376").Select
    41. Range("CO1:CR376").Interior.Color = RGB(255, 0, 0)
    42. Range("CS1:CZ376").Select
    43. Range("CS1:CZ376").Interior.Color = RGB(46, 139, 87)
    44. Range("DA1:DB376").Select
    45. Range("DA1:DB376").Interior.Color = RGB(255, 0, 0)
    46. Range("DC1:DH376").Select
    47. Range("DC1:DH376").Interior.Color = RGB(0, 0, 255)
    48. Range("DI1:DL376").Select
    49. Range("DI1:DL376").Interior.Color = RGB(255, 0, 0)
    50. Range("DM1:DP376").Select
    51. Range("DM1:DP376").Interior.Color = RGB(0, 0, 0)
    52. Range("DQ1:DT376").Select
    53. Range("DQ1:DT376").Interior.Color = RGB(255, 255, 0)
    54. Range("DU1:DX376").Select
    55. Range("DU1:DX376").Interior.Color = RGB(0, 0, 0)
    56. Range("DY1:EB376").Select
    57. Range("DY1:EB376").Interior.Color = RGB(255, 255, 0)
    58. Range("EC1:EF376").Select
    59. Range("EC1:EF376").Interior.Color = RGB(0, 0, 0)
    60. Range("EG1:EL376").Select
    61. Range("EG1:EL376").Interior.Color = RGB(190, 190, 190)
    62. Range("EM1:ER376").Select
    63. Range("EM1:ER376").Interior.Color = RGB(0, 0, 0)
    64. Range("ES1:FF376").Select
    65. Range("ES1:FF376").Interior.Color = RGB(100, 149, 237)
    66. Range("FG1:FG376").Select
    67. Range("FG1:FG376").Interior.Color = RGB(255, 0, 0)
    68. Range("FH1:FK376").Select
    69. Range("FH1:FK376").Interior.Color = RGB(0, 0, 0)
    70. Range("FL1:FL376").Select
    71. Range("FL1:FL376").Interior.Color = RGB(255, 0, 0)
    72. Range("FM1:FR376").Select
    73. Range("FM1:FR376").Interior.Color = RGB(100, 149, 237)
    74. Range("FS1:FX376").Select
    75. Range("FS1:FX376").Interior.Color = RGB(255, 0, 0)
    76. Range("FY1:GD376").Select
    77. Range("FY1:GD376").Interior.Color = RGB(100, 149, 237)
    78. Range("GE1:GE376").Select
    79. Range("GE1:GE376").Interior.Color = RGB(255, 0, 0)
    80. Range("GF1:GI376").Select
    81. Range("GF1:GI376").Interior.Color = RGB(0, 0, 0)
    82. Range("GJ1:GJ376").Select
    83. Range("GJ1:GJ376").Interior.Color = RGB(255, 0, 0)
    84. Range("GK1:GX376").Select
    85. Range("GK1:GX376").Interior.Color = RGB(100, 149, 237)
    86. Range("GY1:HB376").Select
    87. Range("GY1:HB376").Interior.Color = RGB(0, 0, 0)
    88. Range("HC1:HH376").Select
    89. Range("HC1:HH376").Interior.Color = RGB(190, 190, 190)
    90. Range("HI1:HL376").Select
    91. Range("HI1:HL376").Interior.Color = RGB(0, 0, 0)
    92. Range("HM1:HP376").Select
    93. Range("HM1:HP376").Interior.Color = RGB(255, 255, 0)
    94. Range("HQ1:HT376").Select
    95. Range("HQ1:HT376").Interior.Color = RGB(0, 0, 0)
    96. Range("HU1:HX376").Select
    97. Range("HU1:HX376").Interior.Color = RGB(255, 255, 0)
    98. Range("HY1:ID376").Select
    99. Range("HY1:ID376").Interior.Color = RGB(0, 0, 0)
    100. Range("IE1:IH376").Select
    101. Range("IE1:IH376").Interior.Color = RGB(255, 0, 0)
    102. Range("II1:IN376").Select
    103. Range("II1:IN376").Interior.Color = RGB(0, 0, 255)
    104. Range("IO1:IP376").Select
    105. Range("IO1:IP376").Interior.Color = RGB(255, 0, 0)
    106. Range("IQ1:IV376").Select
    107. Range("IQ1:IV376").Interior.Color = RGB(46, 139, 87)
    108. Range("IW1:JJ376").Select
    109. Range("IW1:JJ376").Interior.Color = RGB(100, 149, 237)
    110. Range("JK1:JP376").Select
    111. Range("JK1:JP376").Interior.Color = RGB(0, 0, 0)
    112. Range("JQ1:JV376").Select
    113. Range("JQ1:JV376").Interior.Color = RGB(190, 190, 190)
    114. Range("JW1:JZ376").Select
    115. Range("JW1:JZ376").Interior.Color = RGB(0, 0, 0)
    116. Range("KA1:KD376").Select
    117. Range("KA1:KD376").Interior.Color = RGB(255, 255, 0)
    118. Range("KE1:KH376").Select
    119. Range("KE1:KH376").Interior.Color = RGB(0, 0, 0)
    120. Range("KI1:KL376").Select
    121. Range("KI1:KL376").Interior.Color = RGB(255, 255, 0)
    122. Range("KM1:KR376").Select
    123. Range("KM1:KR376").Interior.Color = RGB(0, 0, 0)
    124. Range("KS1:KV376").Select
    125. Range("KS1:KV376").Interior.Color = RGB(255, 0, 0)
    126. Range("KW1:LB376").Select
    127. Range("KW1:LB376").Interior.Color = RGB(0, 0, 255)
    128. Range("LC1:LD376").Select
    129. Range("LC1:LD376").Interior.Color = RGB(255, 0, 0)
    130. Range("LE1:LL376").Select
    131. Range("LE1:LL376").Interior.Color = RGB(46, 139, 87)
    132. Range("LM1:LO376").Select
    133. Range("LM1:LO376").Interior.Color = RGB(255, 0, 0)
    134. Range("LP1:LW376").Select
    135. Range("LP1:LW376").Interior.Color = RGB(46, 139, 87)
    136. Range("LX1:MA376").Select
    137. Range("LX1:MA376").Interior.Color = RGB(255, 0, 0)
    138. Range("MB1:MI376").Select
    139. Range("MB1:MI376").Interior.Color = RGB(46, 139, 87)
    140. Range("MJ1:MM376").Select
    141. Range("MJ1:MM376").Interior.Color = RGB(255, 0, 0)
    142. Range("MN1:MU376").Select
    143. Range("MN1:MU376").Interior.Color = RGB(46, 139, 87)
    144. Range("MV1:MW376").Select
    145. Range("MV1:MW376").Interior.Color = RGB(255, 0, 0)
    146. Range("MX1:NC376").Select
    147. Range("MX1:NC376").Interior.Color = RGB(0, 0, 255)
    148. Range("ND1:NG376").Select
    149. Range("ND1:NG376").Interior.Color = RGB(255, 0, 0)
    150. Range("NH1:NK376").Select
    151. Range("NH1:NK376").Interior.Color = RGB(0, 0, 0)
    152. Range("NL1:NO376").Select
    153. Range("NL1:NO376").Interior.Color = RGB(255, 255, 0)
    154. Range("NP1:NS376").Select
    155. Range("NP1:NS376").Interior.Color = RGB(0, 0, 0)
    156. Range("NT1:NW376").Select
    157. Range("NT1:NW376").Interior.Color = RGB(255, 255, 0)
    158. Range("NX1:OA376").Select
    159. Range("NX1:OA376").Interior.Color = RGB(0, 0, 0)
    160. Range("OB1:OG376").Select
    161. Range("OB1:OG376").Interior.Color = RGB(190, 190, 190)
    162. Range("OH1:OM376").Select
    163. Range("OH1:OM376").Interior.Color = RGB(0, 0, 0)
    164. Range("ON1:PA376").Select
    165. Range("ON1:PA376").Interior.Color = RGB(100, 149, 237)
    166. Range("PB1:PB376").Select
    167. Range("PB1:PB376").Interior.Color = RGB(255, 0, 0)
    168. Range("PC1:PF376").Select
    169. Range("PC1:PF376").Interior.Color = RGB(0, 0, 0)
    170. Range("PG1:PG376").Select
    171. Range("PG1:PG376").Interior.Color = RGB(255, 0, 0)
    172. Range("PH1:PM376").Select
    173. Range("PH1:PM376").Interior.Color = RGB(100, 149, 237)
    174. Range("PN1:PS376").Select
    175. Range("PN1:PS376").Interior.Color = RGB(255, 0, 0)
    176. Range("PT1:PY376").Select
    177. Range("PT1:PY376").Interior.Color = RGB(100, 149, 237)
    178. Range("PZ1:PZ376").Select
    179. Range("PZ1:PZ376").Interior.Color = RGB(255, 0, 0)
    180. Range("QA1:QD376").Select
    181. Range("QA1:QD376").Interior.Color = RGB(0, 0, 0)
    182. Range("QE1:QE376").Select
    183. Range("QE1:QE376").Interior.Color = RGB(255, 0, 0)
    184. Range("QF1:QS376").Select
    185. Range("QF1:QS376").Interior.Color = RGB(100, 149, 237)
    186. Range("QT1:QW376").Select
    187. Range("QT1:QW376").Interior.Color = RGB(0, 0, 0)
    188. Range("QX1:RC376").Select
    189. Range("QX1:RC376").Interior.Color = RGB(190, 190, 190)
    190. Range("RD1:RG376").Select
    191. Range("RD1:RG376").Interior.Color = RGB(0, 0, 0)
    192. Range("RH1:RK376").Select
    193. Range("RH1:RK376").Interior.Color = RGB(255, 255, 0)
    194. Range("RL1:RO376").Select
    195. Range("RL1:RO376").Interior.Color = RGB(0, 0, 0)
    196. Range("RP1:RS376").Select
    197. Range("RP1:RS376").Interior.Color = RGB(255, 255, 0)
    198. Range("RT1:RY376").Select
    199. Range("RT1:RY376").Interior.Color = RGB(0, 0, 0)
    200. Range("RZ1:SC376").Select
    201. Range("RZ1:SC376").Interior.Color = RGB(255, 0, 0)
    202. Range("SD1:SI376").Select
    203. Range("SD1:SI376").Interior.Color = RGB(0, 0, 255)
    204. Range("SJ1:SK376").Select
    205. Range("SJ1:SK376").Interior.Color = RGB(255, 0, 0)
    206. Range("SL1:SQ376").Select
    207. Range("SL1:SQ376").Interior.Color = RGB(46, 139, 87)
    208. ChDir _
    209. "Macintosh HD:Users:chrisgarthwaite:Documents:Excel ƒ: Hubs and SITES:wikiHow's:"
    210. Range("SL1:SQ376").Select
    211. ActiveWorkbook.SaveAs Filename:= _
    212. "Macintosh HD:Users:chrisgarthwaite:Documents:Excel ƒ:Tartan Work: Anderson Tartan Development.xlsx" _
    213. , FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
    214. Macro1_Vertical_Row_Sampler
    215. End Sub
    216. Sub Macro1_Vertical_Row_Sampler()
    217. '
    218. ' Macro1_Vertical_Row_Sampler Macro
    219. ' Vertical Row Sampler
    220. ' Top to bottom
    221. Range("A2").Select
    222. ActiveWorkbook.Names.Add Name:="Tartan_Vertical_StarterCell", RefersToR1C1 _
    223. :="=Sheet1!R2C1"
    224. Range("A1:A210").Select
    225. Selection.RowHeight = 18
    226. Range("A2:A10").Select
    227. Range("A2").Interior.Color = RGB(0, 0, 0)
    228. Range("A11:A16").Select
    229. Range("A11").Interior.Color = RGB(255, 0, 0)
    230. Range("A17:A23").Select
    231. Range("A17").Interior.Color = RGB(0, 0, 0)
    232. Range("A24:A29").Select
    233. Range("A24").Interior.Color = RGB(255, 0, 0)
    234. Range("A30:A36").Select
    235. Range("A30").Interior.Color = RGB(0, 0, 0)
    236. Range("A37:A38").Select
    237. Range("A37").Interior.Color = RGB(255, 0, 0)
    238. Range("A39:A42").Select
    239. Range("A39").Interior.Color = RGB(0, 0, 255)
    240. Range("A43:A44").Select
    241. Range("A43").Interior.Color = RGB(255, 0, 0)
    242. Range("A45:A48").Select
    243. Range("A45").Interior.Color = RGB(0, 0, 0)
    244. Range("A49").Select
    245. Range("A49").Interior.Color = RGB(255, 255, 0)
    246. Range("A50").Select
    247. Range("A50").Interior.Color = RGB(0, 0, 0)
    248. Range("A51").Select
    249. Range("A51").Interior.Color = RGB(255, 255, 0)
    250. Range("A52:A55").Select
    251. Range("A52").Interior.Color = RGB(0, 0, 0)
    252. Range("A56:A59").Select
    253. Range("A56").Interior.Color = RGB(224, 255, 255)
    254. Range("A60:A65").Select
    255. Range("A60").Interior.Color = RGB(0, 0, 0)
    256. Range("A66:A85").Select
    257. Range("A66").Interior.Color = RGB(0, 255, 255)
    258. Range("A86:A87").Select
    259. Range("A86").Interior.Color = RGB(255, 0, 0)
    260. Range("A88:A91").Select
    261. Range("A88").Interior.Color = RGB(0, 0, 0)
    262. Range("A92:A93").Select
    263. Range("A92").Interior.Color = RGB(255, 0, 0)
    264. Range("A94:A101").Select
    265. Range("A94").Interior.Color = RGB(0, 255, 255)
    266. Range("A102:A107").Select
    267. Range("A102").Interior.Color = RGB(255, 0, 0)
    268. Range("A108:A115").Select
    269. Range("A108").Interior.Color = RGB(0, 255, 255)
    270. Range("A116:A117").Select
    271. Range("A116").Interior.Color = RGB(255, 0, 0)
    272. Range("A118:A121").Select
    273. Range("A118").Interior.Color = RGB(0, 0, 0)
    274. Range("A122:A123").Select
    275. Range("A122").Interior.Color = RGB(255, 0, 0)
    276. Range("A124:A143").Select
    277. Range("A124").Interior.Color = RGB(0, 255, 255)
    278. Range("A144:A149").Select
    279. Range("A144").Interior.Color = RGB(0, 0, 0)
    280. Range("A150:A153").Select
    281. Range("A150").Interior.Color = RGB(224, 255, 255)
    282. Range("A154:A157").Select
    283. Range("A154").Interior.Color = RGB(0, 0, 0)
    284. Range("A158").Select
    285. Range("A158").Interior.Color = RGB(255, 255, 0)
    286. Range("A159").Select
    287. Range("A159").Interior.Color = RGB(0, 0, 0)
    288. Range("A160").Select
    289. Range("A160").Interior.Color = RGB(255, 255, 0)
    290. Range("A161:A164").Select
    291. Range("A161").Interior.Color = RGB(0, 0, 0)
    292. Range("A165:A166").Select
    293. Range("A165").Interior.Color = RGB(255, 0, 0)
    294. Range("A167:A170").Select
    295. Range("A167").Interior.Color = RGB(0, 0, 255)
    296. Range("A171:A172").Select
    297. Range("A171").Interior.Color = RGB(255, 0, 0)
    298. Range("A173:A179").Select
    299. Range("A173").Interior.Color = RGB(0, 0, 0)
    300. Range("A180:A185").Select
    301. Range("A180").Interior.Color = RGB(255, 0, 0)
    302. Range("A186:A192").Select
    303. Range("A186").Interior.Color = RGB(0, 0, 0)
    304. Range("A193:A198").Select
    305. Range("A193").Interior.Color = RGB(255, 0, 0)
    306. Range("A199:A205").Select
    307. Range("A199").Interior.Color = RGB(0, 0, 0)
    308. Range("A206").Select
    309. ActiveCell.FormulaR1C1 = "End"
    310. ActiveWorkbook.Save
    311. Application.ScreenUpdating = False
    312. Macro3
    313. End Sub
    314. Sub Macro3()
    315. ' Macro3 Macro
    316. Windows(" Anderson Tartan Development.xlsx").Activate
    317. Application.Goto Reference:="Tartan_Vertical_StarterCell"
    318. 'Make the first 9 rows black
    319. Macro6
    320. For X03 = 1 To 7
    321. Macro8
    322. Next
    323. 10 Application.CutCopyMode = False
    324. 'Make the next 6 rows red
    325. Macro7
    326. For X03 = 1 To 4
    327. Macro8
    328. Next
    329. 30 Application.CutCopyMode = False
    330. 'Make the next 7 rows black
    331. Macro7
    332. For X03 = 1 To 5
    333. Macro8
    334. Next
    335. 50 Application.CutCopyMode = False
    336. 'Make the next 6 rows red
    337. Macro6
    338. For X03 = 1 To 4
    339. Macro8
    340. Next
    341. 70 Application.CutCopyMode = False
    342. 'Make the next 7 rows black
    343. Macro6
    344. For X03 = 1 To 5
    345. Macro8
    346. Next
    347. 90 Application.CutCopyMode = False
    348. 'Make the next 2 rows red
    349. Macro6
    350. 100 Application.CutCopyMode = False
    351. 'Make the next 4 rows blue-purple�
    352. Macro6
    353. For X03 = 1 To 2
    354. Macro8
    355. Next
    356. 130 Application.CutCopyMode = False
    357. 'Make the next 2 rows red
    358. Macro6
    359. 140 Application.CutCopyMode = False
    360. 'Make the next 4 rows black
    361. Macro6
    362. For X03 = 1 To 2
    363. Macro8
    364. Next
    365. 170 Application.CutCopyMode = False
    366. 'Make the next SINGLE ROW yellow
    367. Selection.Copy
    368. ActiveCell.Offset(0, 1).Select
    369. ActiveSheet.Paste
    370. 180 For X01 = 1 To 255
    371. ActiveCell.Offset(0, 2).Select
    372. ActiveSheet.Paste
    373. Next
    374. ActiveCell.Offset(1, -511).Select
    375. 190 Application.CutCopyMode = False
    376. 'Make the next SINGLE ROW black
    377. Selection.Copy
    378. ActiveCell.Offset(0, 2).Select
    379. ActiveSheet.Paste
    380. 200 For X01 = 1 To 255
    381. ActiveCell.Offset(0, 2).Select
    382. ActiveSheet.Paste
    383. Next
    384. ActiveCell.Offset(1, -512).Select
    385. 210 Application.CutCopyMode = False
    386. 'Make the next SINGLE ROW yellow
    387. Selection.Copy
    388. ActiveCell.Offset(0, 1).Select
    389. ActiveSheet.Paste
    390. 220 For X01 = 1 To 255
    391. ActiveCell.Offset(0, 2).Select
    392. ActiveSheet.Paste
    393. Next
    394. ActiveCell.Offset(1, -511).Select
    395. 230 Application.CutCopyMode = False
    396. 'Make the next 4 rows black
    397. Macro6
    398. For X03 = 1 To 2
    399. Macro8
    400. Next
    401. 270 Application.CutCopyMode = False
    402. 'Make the next 4 rows white
    403. Macro7
    404. For X03 = 1 To 2
    405. Macro8
    406. Next
    407. 280 Application.CutCopyMode = False
    408. 'Make the next 6 rows black
    409. Macro6
    410. For X03 = 1 To 4
    411. Macro8
    412. Next
    413. 290 Application.CutCopyMode = False
    414. 'Make the next 20 rows blue-green
    415. Macro6
    416. For X03 = 1 To 18
    417. Macro8
    418. Next
    419. 310 Application.CutCopyMode = False
    420. 'Make the next 2 rows red
    421. Macro6
    422. 320 Application.CutCopyMode = False
    423. 'Make the next 4 rows black
    424. Macro6
    425. For X03 = 1 To 2
    426. Macro8
    427. Next
    428. 350 Application.CutCopyMode = False
    429. 'Make the next 2 rows red
    430. Macro6
    431. 360 Application.CutCopyMode = False
    432. 'Make the next 8 rows blue-green
    433. Macro6
    434. For X03 = 1 To 6
    435. Macro8
    436. Next
    437. 410 Application.CutCopyMode = False
    438. 'Make the next 6 rows red
    439. Macro6
    440. For X03 = 1 To 4
    441. Macro8
    442. Next
    443. 430 Application.CutCopyMode = False
    444. Macro6
    445. For X03 = 1 To 6
    446. Macro8
    447. Next
    448. 450 Application.CutCopyMode = False
    449. 'Make the next 2 rows red
    450. Macro6
    451. 470 Application.CutCopyMode = False
    452. 'Make the next 4 rows black
    453. Macro6
    454. For X03 = 1 To 2
    455. Macro8
    456. Next
    457. 490 Application.CutCopyMode = False
    458. 'Make the next 2 rows red
    459. Macro6
    460. 500 Application.CutCopyMode = False
    461. 'Make the next 20 rows blue-green
    462. Macro6
    463. For X03 = 1 To 18
    464. Macro8
    465. Next
    466. 530 Application.CutCopyMode = False
    467. 'Make the next 6 rows black
    468. Macro6
    469. For X03 = 1 To 4
    470. Macro8
    471. Next
    472. 550 Application.CutCopyMode = False
    473. 'Make the next 4 rows white
    474. Macro6
    475. For X03 = 1 To 2
    476. Macro8
    477. Next
    478. 570 Application.CutCopyMode = False
    479. 'Make the next 4 rows black
    480. Macro6
    481. For X03 = 1 To 2
    482. Macro8
    483. Next
    484. 590 Application.CutCopyMode = False
    485. 'Make the next SINGLE ROW yellow
    486. Selection.Copy
    487. 600 For X01 = 1 To 255
    488. ActiveCell.Offset(0, 2).Select
    489. ActiveSheet.Paste
    490. Next
    491. ActiveCell.Offset(1, -510).Select
    492. 610 Application.CutCopyMode = False
    493. 'Make the next SINGLE ROW black
    494. Selection.Copy
    495. ActiveCell.Offset(0, 1).Select
    496. ActiveSheet.Paste
    497. 620 For X01 = 1 To 255
    498. ActiveCell.Offset(0, 2).Select
    499. ActiveSheet.Paste
    500. Next
    501. ActiveCell.Offset(1, -511).Select
    502. 630 Application.CutCopyMode = False
    503. 'Make the next SINGLE ROW yellow
    504. Selection.Copy
    505. 640 For X01 = 1 To 255
    506. ActiveCell.Offset(0, 2).Select
    507. ActiveSheet.Paste
    508. Next
    509. ActiveCell.Offset(1, -510).Select
    510. 650 Application.CutCopyMode = False
    511. 'Make the next 4 rows black
    512. Macro7
    513. For X03 = 1 To 2
    514. Macro8
    515. Next
    516. 670 Application.CutCopyMode = False
    517. 'Make the next 2 rows red
    518. Macro6
    519. 690 Application.CutCopyMode = False
    520. 'Make the next 4 rows blue-purple
    521. Macro7
    522. For X03 = 1 To 2
    523. Macro8
    524. Next
    525. 740 Application.CutCopyMode = False
    526. 'Make the next 2 rows red
    527. Macro6
    528. 750 Application.CutCopyMode = False
    529. 'Make the next 7 rows black
    530. Macro7
    531. For X03 = 1 To 5
    532. Macro8
    533. Next
    534. 780 Application.CutCopyMode = False
    535. 'Make the next 6 rows red
    536. Macro6
    537. For X03 = 1 To 4
    538. Macro8
    539. Next
    540. 800 Application.CutCopyMode = False
    541. 'Make the next 7 rows black
    542. Macro6
    543. For X03 = 1 To 5
    544. Macro8
    545. Next
    546. 820 Application.CutCopyMode = False
    547. 'Make the next 6 rows red
    548. Macro7
    549. For X03 = 1 To 4
    550. Macro8
    551. Next
    552. 840 Application.CutCopyMode = False
    553. 'Make the next (the last) 7 rows black
    554. Macro7
    555. For X03 = 1 To 5
    556. Macro8
    557. Next
    558. 870 Application.CutCopyMode = False
    559. Columns("B:SQ").Select
    560. Range("B178").Activate
    561. Selection.ColumnWidth = 0.18
    562. Rows("2:205").Select
    563. Range("A205").Activate
    564. Selection.RowHeight = 4
    565. Macro11
    566. ActiveWorkbook.SaveAs Filename:= _
    567. "Macintosh HD:Users:chrisgarthwaite:Documents:Excel ƒ:Tartan Work: Anderson Tartan Development.xlsm" _
    568. , FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
    569. End Sub
    570. Sub Macro6()
    571. ' Macro6 Macro
    572. Selection.Copy
    573. 0 For X01 = 1 To 255
    574. ActiveCell.Offset(0, 2).Select
    575. ActiveSheet.Paste
    576. Next
    577. ActiveCell.Offset(1, -510).Select
    578. ActiveSheet.Paste
    579. ActiveCell.Offset(0, 1).Select
    580. ActiveSheet.Paste
    581. For X02 = 1 To 255
    582. ActiveCell.Offset(0, 2).Select
    583. ActiveSheet.Paste
    584. Next
    585. ActiveCell.Offset(1, -511).Select
    586. End Sub
    587. Sub Macro7()
    588. ' Macro7 Macro
    589. Selection.Copy
    590. ActiveCell.Offset(0, 1).Select
    591. ActiveSheet.Paste
    592. 20 For X01 = 1 To 255
    593. ActiveCell.Offset(0, 2).Select
    594. ActiveSheet.Paste
    595. Next
    596. ActiveCell.Offset(1, -511).Select
    597. ActiveSheet.Paste
    598. For X02 = 1 To 255
    599. ActiveCell.Offset(0, 2).Select
    600. ActiveSheet.Paste
    601. Next
    602. ActiveCell.Offset(1, -510).Select
    603. ActiveSheet.Paste
    604. End Sub
    605. Sub Macro8()
    606. ' Macro8 Macro
    607. ActiveCell.Offset(-2, 510).Select
    608. ActiveWorkbook.Names.Add Name:="RightEnd", RefersToR1C1:=ActiveCell
    609. ActiveCell.Offset(2, -510).Select
    610. ActiveCell.Offset(-2, 0).Select
    611. ActiveWorkbook.Names.Add Name:="LeftEnd", RefersToR1C1:=ActiveCell
    612. Application.Goto Reference:="LeftEnd: RightEnd"
    613. Selection.Copy
    614. ActiveCell.Offset(2, 0).Select
    615. ActiveSheet.Paste
    616. ActiveCell.Offset(1, 0).Select
    617. ActiveWorkbook.Save
    618. End Sub
    619. Sub Macro11()
    620. ' Macro11 Macro
    621. Columns("A:A").Select
    622. Selection.Copy
    623. Columns("SR:SR").Select
    624. ActiveSheet.Paste
    625. Columns("SS:SS").Select
    626. Application.CutCopyMode = False
    627. Selection.Delete Shift:=xlToLeft
    628. Range("A1").Select
    629. End Sub
    630. Be patient, please. 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!!
  1. Picture 3 of How to Make a Tartan Heart Image in Excel
    Final image:
Update 05 March 2020
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile