Showing posts with label File Conversion. Show all posts
Showing posts with label File Conversion. Show all posts

Tuesday, June 21, 2022

How to change relative hyperlink to exact link in Excel

You may have used the HYPERLINK function in Excel before but what you may not have released is your links can be either relative or absolute (or sometimes called exact or specific). What does this even mean? And how do you change from relative to exact?

Wednesday, July 13, 2016

How to Write a Book Fast by Using Excel - Video Tutorial

Where most authors are writing their books in Microsoft Word, Scrivener, or Pages for Mac, I’ve actually been using Microsoft Excel to write books fast and today I’m going to show you my exact technique. You can see an example of one of my books created in Excel by checking out The 50 Most Terrifying Roller Coasters Ever Built on Amazon.com. As you can see, it has a 4.5 star rating from 14 reviews - none of which are from people I know, all real readers and customer - and has sold more than 2,000 copies. I’ve written four books using this technique and I chose this niche because I have a real passion for roller coasters and amusement parks.

Why write a book in Excel?


List type blog posts and articles are very popular these days, so my idea was to turn one of these type of list posts into a short book. This method is probably not a good idea for every type of book. You wouldn’t want to write a novel or long work of fiction in Excel. But if you're trying to relay stats or facts or have some form of repetition then this technique could help save you a lot of time. Anytime you find yourself doing something over and over or thinking to yourself "there has to be a better way" then, guess what, there probably is a better way and macros could be the answer.

How do you write a book in Excel?

Each row in my spreadsheet template starts a different page in the book. So 50 coasters equals at least 50 pages. I’ve colored coded the spreadsheet: every column in green is my initial input. Orange columns are formulas that use information from two other columns. All columns without color contain data that was entered by a virtual assistant whom I hired specifically for this job from Upwork.

Basically, I came up with the list of 50 coasters I wanted to feature in the book, then I outsourced the data collection process using Upwork. While my virtual assistant was contacting theme parks and researching data, I wrote the code to the macro that would automatically export all the data from Excel into the format in Word that I was looking for. The macro runs through a simple For..Next loop, looping through each row of the spreadsheet and exporting the data into the Word document.



After the information is exported to Word, just add your typical front and back matter, pictures, edit, and you’re done. Uploading to CreateSpace and Kindle Direct Publishing is a breeze. And you can outsource most of these tasks as well, if you have the budget for it. Or do it yourself. Most people don't realize that if you have something written, it could be on sale on Amazon.com in as little as two days. Heck, some guy got a picture of his foot to be a best seller.


Watch My Book Magically Appear


Watch the video tutorial below where I show you how to write a book fast by using Excel and see the book pages magically appear before your very eyes.


Steps to Write a Book Using Excel


Here's the basic steps I use to start writting my book with a spreadsheet:
  1. Setup Excel sheet
  2. Outsource data entry using Upwork
  3. Create macro to automatically export data to Word
  4. Run Macro
  5. Add front and back matter, pictures, etc. to book in Word document
  6. Edit and create front cover
  7. Publish on CreateSpace and KDP
  8. Market and promotion
Feel free to contact me if you'd like to know more or have questions about how the macro works to export the data from Excel into Word.

Monday, September 23, 2013

How to Combine Excel Files

There have been countless times during my day job when I’ve had to combine multiple Excel files into one. I used to do it the old fashioned way of copy and paste but after doing this tedious and time consuming task I decided to write a VBA macro to help me out. I’ve now made the template available for you to use for free. This version of the combine Excel workbooks macro allows you to choose the directory of the Excel files to copy without having to change the code in the Visual Basic Editor. The steps to use the Combine Workbooks tool are as follows:

combine excel files macro
 
  1. Place the Excel workbooks you want to combine into a single folder that contains no other files
  2. Go to View>Macros
  3. Select "Combine Workbooks" then click Run
  4. Select the File where the spreadsheets you want to combine are located
  5. Save the newly created file

Instructions are provided with the spreadsheet

Please note that this code will not work on protected sheets and it will automatically skip any blank worksheets in any of the workbooks saved in the folder. See how it works for yourself by watching my short demo video below:
 

 
Download the Combine Excel Files spreadsheet that contains the VBA code to copy all the worksheets from all the workbooks in a folder into the active workbook using this link:
 

Combine Files.xlsm download

Tuesday, April 9, 2013

My Excel 2016 Wishlist

Today, I started thinking about my Excel 2016 wishlist. Microsoft Excel has been updated every three years beginning in 2007. Knowing this, we can only assume the next edition of Excel will come out in three years from now in 2016. The latest update, Excel 2013, includes new tools like FlashFill, PowerView, Timeline Slicer, and over 50 new functions. Don’t get me wrong, Excel is a very powerful tool but it’s not completely perfect yet.
excel 2016 logo

Thus, it’s never too early to start thinking about the next edition of Excel and what improvements can be made. There are a number of features that I think would make creating spreadsheets even easier. A couple of simple improvements could help save users even more time. Here are some of the things I’d like to see in Excel 2016:



  • A FIXTODAY() function that holds the date of the day the formula was first created or entered into the spreadsheet.
  • I don’t know if this will ever be possible outside of Google Docs but allowing multiple users to edit the same document at the same time would be wonderful.This would eliminate all those extra copies of spreadsheets floating around.  This option is already available!
  • I don’t know why you can’t do this already but it would be great to be able to unhide multiple worksheets at the same time. Currently, you can only unhide one sheet at a time which can be a major headache and quite inconvenient.
  • Along this same line, I would like the ability to unprotect multiple sheets at once. Something like a global password may be the solution.
  • An easy way to be able to see exact revision history.
  • More options when protecting a sheet, like being able to use CustomViews.
  • More text manipulation functions and options.

That’s what I think. What about you? What would you like to see in future versions of Excel? What’s on your Excel 2016 wishlist? Please let me know in the comments below. Who knows, maybe Microsoft will even be taking notes!

Tuesday, March 5, 2013

Macro to Export Hyperlinks from Excel to Word


In this tutorial I am going to show you how to write a VBA macro to export hyperlinks from Excel to Word. I’m all about automation and efficiency and this is another real world example. I used this macro to quickly create a table of the world’s observation wheels for my latest website.

What you will learn by reading through this tutorial:

  • How to create a VBA macro to send data from Excel to Word
  • How to export hyperlinks from Excel
  • How to find the last row of data in an Excel sheet using a macro
  • How to paste hyperlink into Word using a macro
  • How to make a webpage from an Excel file

To begin, we have an Excel sheet with names in column A, some of them are hyperlinks to webpages and some of them are not. Hit Alt + F8 and create a new macro, I named mined Tables. It’s time to begin coding.
 
export hyperlinks from excel to word

 

The first thing we need to do is create a new instance of Microsoft Word and make it visible:

 

Dim appWD As Word.Application

Set appWD = CreateObject("Word.Application")

appWD.Visible = True

 

Next, let’s find the last row that contains data within our active Excel spreadsheet (my sheet is called “Data”):

 

Sheets("Data").Select

            Dim FinalRow As Integer

 

            FinalRow = Range("A9999").End(xlUp).Row

 

Now we add some error handling - if there is no data then quit the program, otherwise continue on:

If FinalRow = 0 Then

            Exit Sub

 

            Else

 

As a check, I like to have a message box pop-up displaying the total number of rows with data:

 

            MsgBox "Number of rows is " & FinalRow

 

Now it’s time to tell Word to create a new document. We’ll also add our header text by using TypeText. TypeParagraph inserts a new paragraph by going to the next line:

 

            appWD.Documents.Add

            appWD.Selection.TypeParagraph

 

            appWD.Selection.TypeText Text:="[table caption= List of Observation Wheels]"

 

            appWD.Selection.TypeParagraph

 

            appWD.Selection.TypeText Text:="Name,Height(m)"

Next, we’ll create a For...Next loop to cycle through every row and look to see if there is a hyperlink in column A. If there is a hyperlink, we want to copy it, if not then we still want to copy any text in the cell.

 

Dim hyperlink1 As String

Dim i As Integer

 

            For i = 2 To FinalRow

 

            If Range("A" & i).Hyperlinks.Count > 0 Then

 
 

            'if there is a hyperlink

 

            appWD.Selection.TypeParagraph

 

            hyperlink1 = Range("A" & i).Hyperlinks(1).Address

 

            appWD.ActiveDocument.Hyperlinks.Add Anchor:=appWD.Selection.Range,          Address:=hyperlink1, SubAddress:="", ScreenTip:="", TextToDisplay:=Range("A" & i)

 

            appWD.Selection.TypeText Text:="," & Range("B" & i)

 
 

            Else

 
 

            'If no hyperlink

 

            appWD.Selection.TypeParagraph

 

            appWD.Selection.TypeText Text:=Range("A" & i) & "," & Range("B" & i)

 
 

            End If

 

            Next 'i

 

Finally, we can add any text at the bottom of the document and close the if and sub statements.

 

            'end the table

            appWD.Selection.TypeParagraph

            appWD.Selection.TypeText Text:="[/table]"

            End If

            End Sub

create webpage from excel with macro
 

You may have noticed I began and ended with [table] and [/table]. I installed a Wordpress plugin on my website that enables me to easily insert sortable tables into my webpage without any major html coding involved. So now I can run my macro on my spreadsheet, copy the result it spits out into Word, and paste the text into my website. Here is the end result, a sortable table of all large observation wheels found throughout the world! Pretty cool huh?

Wednesday, February 20, 2013

How to Embed Excel in a Website

One thing I wanted to learn when I created this blog was how to embed Excel spreadsheets into a website. Thanks to free file sharing services like www.box.com embeding files into websites has become a very simple process (and see why I highly recommend you create a website). The very first thing you need to do is to go and register an account at a file sharing website. I use Box.com because it’s free and has many unique features, like keeping stats of how many times your spreadsheets are viewed or downloaded. Once you have an account, follow these five easy steps once you have your Excel spreadsheet ready to upload:
 
Step 1: Create a folder
This folder is where you will upload your spreadsheet. OK, you actually don’t have to do this step but it helps to keep your files organized which is why I recommend you do it.

how to embed excel in a website



Step 2: Upload your spreadsheet to your folder
Go to your folder then upload your spreadsheet to by clicking Upload.

Step 3: Copy the markup

When the file is done uploading click the down arrow, scroll down to Share, then click Embed File in Your Site. Now you may adjust the width, height, and color as well as setting other options like allowing printing or downloading. When ready, click Copy to Clickboard to grab the embed code (or markup).


how to embed spreadsheet

Step 4: Go to your blog

The markup you copied is supported in many web authoring environments and blog services. Go to your blog editor, begin writing your post, then switch to HTML editing.


Step 5: Paste and post

Make sure the markup you copied is the most recent item in your Clipboard and press CTRL + V. You’ve just embedded an Excel spreadsheet into your website! See the example below:



Concluding Thoughts

There are other file sharing services you can use to embed a spreadsheet, like Microsoft’s SkyDrive and CometDocs, but I have had a great experience with Box.

-Nick
Spreadsheet Embedder