+ Reply to Thread
Results 1 to 6 of 6

Macro to convert my Firefox 27.0.1 bookmarks to Excel 2010

  1. #1
    Registered User
    Join Date
    05-24-2011
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    41

    Macro to convert my Firefox 27.0.1 bookmarks to Excel 2010

    I export my Firefox bookmarks . . . and did this macro to automate it, which I have been doing manually (these are my source notes) . . . I have a question in here, at the pertinent point:

    File \ Open \ Desktop \ bookmarks.html
    Yes . . . Delimited . . . No Tab / Other " . . . Finish
    View / Arrange All / Horizontal / Ok
    Zoom to 80% . . . Microsoft Sans Serif . . . 10 point

    Highlight columns in yellow ... B - G - I - K - M . . . M is the last column
    Clear Col A for a sort number index . . . Center the text
    Delete all of the other non-yellow columns through M
    Column Width of ... B - C - D - E - F ... to 25

    Ctrl+Home . . . Ctrl+F for: "Unsorted"
    It's always on row 123, unless I add bookmarks that stay there (then I'll have to re-do this macro)
    There will be a long number in the URL column, right aligned, above these new URLs
    Highlight Row 123 . . . Shift+Ctrl+Arrow Up . . . Right-click / Delete

    Ctrl+Home . . . In Cells A1 and A2, put 1 and 2
    Put a sort number index in Col A, drag bottom right corner all the way to 500

    Ctrl+End . . . Shift+Home+Ctrl+Home
    Sort on Col B, the URL, to get rid of spaces

    Ctrl+End . . . Home . . Arrow Right . . . Ctrl+Up . . . Arrow down
    Delete everything that was a space, all the way to the bottom:
    Shift+Ctrl+Arrow Down+Arrow Down . . . Right-click / Delete
    This is where the problem lies.
    The row it finds here will probably be different every time,
    but the macro keeps the row that was determined, when making the macro.
    Is there a command, like "last active cell" ?
    If I leave this part out of the macro, I get the data I want,
    it's just messy, because I have numbers in Col A,
    and my URLs are not in the original order done.
    The example here is for 25 bookmarks. If I try to process a
    bookmarks.html file of 23 bookmarks, it leaves an extra 2 random lines.
    If I try to process a bookmarks.html file of 11 bookmarks,
    it leaves an extra 14 random lines.

    Ctrl+End . . . Shift+Home+Ctrl+Home
    Sort on Col A, the index, to put URLs back in the original order

    Ctrl+Home
    Put URLs of Col B to the right of the web page names

    Ctrl+Home
    Ctrl+H . . . replace . . . > . . . and . . . </A . . . with nothing
    Unhighlight B - C - D
    Ctrl+Home

    * * * * * * * * * * * * Manual editing part (when I leave out the above issue)

    Run the Macro: Process_Bookmarks
    Sort on Col A, the index, to put URLs back in the order done
    Move some Titles from B - C - D . . . to E
    Sorting on B - C - D can make it easier to get them
    Un-highlight all

    Copy and Paste links to bottom of Favorites / Take a look at them to verify / SAVE
    Close / Dont' Save the Import
    Edit the bookmark Titles for special characters, or go back to web page to get the Title of the page / then categorize
    Delete bookmarks.html on Desktop, and the Unsorted URLs in Firefox
    bookmarks.html will remain in the Recycle Bin for a day or so, in case there are any problems

  2. #2
    Registered User
    Join Date
    05-24-2011
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Macro to convert my Firefox 27.0.1 bookmarks to Excel 2010

    Here is the Macro. I think the issue starts around where it says 26:26 . . . the line number

    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

    Sub Process_Bookmarks()
    '
    ' Process_Bookmarks Macro
    '

    '
    Workbooks.OpenText Filename:="C:\Users\Mark721\Desktop\bookmarks.html", _
    Origin:=xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
    xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False _
    , Comma:=False, Space:=False, Other:=True, OtherChar:="""", FieldInfo _
    :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1)), _
    TrailingMinusNumbers:=True
    Windows.Arrange ArrangeStyle:=xlHorizontal
    ActiveWindow.Zoom = 80
    Cells.Select
    With Selection.Font
    .Name = "Microsoft Sans Serif"
    .Size = 14
    .Strikethrough = False
    .Superscript = False
    .Subscript = False
    .OutlineFont = False
    .Shadow = False
    .Underline = xlUnderlineStyleNone
    .ThemeColor = xlThemeColorLight1
    .TintAndShade = 0
    .ThemeFont = xlThemeFontNone
    End With
    With Selection.Font
    .Name = "Microsoft Sans Serif"
    .Size = 10
    .Strikethrough = False
    .Superscript = False
    .Subscript = False
    .OutlineFont = False
    .Shadow = False
    .Underline = xlUnderlineStyleNone
    .ThemeColor = xlThemeColorLight1
    .TintAndShade = 0
    .ThemeFont = xlThemeFontNone
    End With
    Range("B:B,G:G,I:I,K:K,M:M").Select
    Range("M1").Activate
    With Selection.Interior
    .Pattern = xlSolid
    .PatternColorIndex = xlAutomatic
    .Color = 65535
    .TintAndShade = 0
    .PatternTintAndShade = 0
    End With
    Columns("A:A").Select
    Selection.ClearContents
    With Selection
    .HorizontalAlignment = xlCenter
    .VerticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = False
    End With
    Columns("C:F").Select
    Selection.Delete Shift:=xlToLeft
    Columns("D:D").Select
    Selection.Delete Shift:=xlToLeft
    Columns("E:E").Select
    Selection.Delete Shift:=xlToLeft
    Columns("F:F").Select
    Selection.Delete Shift:=xlToLeft
    Columns("B:F").Select
    Range("F1").Activate
    Selection.ColumnWidth = 25
    Range("A1").Select
    Cells.Find(What:="Unsorted", After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Activate
    Rows("123:123").Select
    Range(Selection, Selection.End(xlUp)).Select
    Selection.Delete Shift:=xlUp
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("A2").Select
    ActiveCell.FormulaR1C1 = "2"
    Range("A1:A2").Select
    Selection.AutoFill Destination:=Range("A1:A500"), Type:=xlFillDefault
    Range("A1:A500").Select
    ActiveCell.SpecialCells(xlLastCell).Select
    Range(Selection, Cells(ActiveCell.Row, 1)).Select
    Range(Selection, Cells(1)).Select
    ActiveWorkbook.Worksheets("bookmarks").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("bookmarks").Sort.SortFields.Add Key:=Range( _
    "B1:B500"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
    xlSortNormal
    With ActiveWorkbook.Worksheets("bookmarks").Sort
    .SetRange Range("A1:M500")
    .Header = xlGuess
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
    End With
    Columns("B:B").Select
    Selection.Cut
    Columns("G:G").Select
    Selection.Insert Shift:=xlToRight
    Range("A1").Select
    Cells.Replace What:=">", Replacement:="", LookAt:=xlPart, SearchOrder:= _
    xlByColumns, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
    Cells.Replace What:="</A", Replacement:="", LookAt:=xlPart, SearchOrder _
    :=xlByColumns, MatchCase:=False, SearchFormat:=False, ReplaceFormat:= _
    False
    Columns("B:D").Select
    With Selection.Interior
    .Pattern = xlNone
    .TintAndShade = 0
    .PatternTintAndShade = 0
    End With
    Range("A1").Select
    End Sub
    Sub Process_Bookmarks_Error()
    '
    ' Process_Bookmarks_Error Macro
    '

    '
    Workbooks.OpenText Filename:="C:\Users\Mark721\Desktop\bookmarks.html", _
    Origin:=xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
    xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False _
    , Comma:=False, Space:=False, Other:=True, OtherChar:="""", FieldInfo _
    :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1)), _
    TrailingMinusNumbers:=True
    Windows.Arrange ArrangeStyle:=xlHorizontal
    ActiveWindow.Zoom = 80
    Cells.Select
    With Selection.Font
    .Name = "Microsoft Sans Serif"
    .Size = 14
    .Strikethrough = False
    .Superscript = False
    .Subscript = False
    .OutlineFont = False
    .Shadow = False
    .Underline = xlUnderlineStyleNone
    .ThemeColor = xlThemeColorLight1
    .TintAndShade = 0
    .ThemeFont = xlThemeFontNone
    End With
    With Selection.Font
    .Name = "Microsoft Sans Serif"
    .Size = 10
    .Strikethrough = False
    .Superscript = False
    .Subscript = False
    .OutlineFont = False
    .Shadow = False
    .Underline = xlUnderlineStyleNone
    .ThemeColor = xlThemeColorLight1
    .TintAndShade = 0
    .ThemeFont = xlThemeFontNone
    End With
    Range("B:B,G:G,I:I,K:K,M:M").Select
    Range("M1").Activate
    With Selection.Interior
    .Pattern = xlSolid
    .PatternColorIndex = xlAutomatic
    .Color = 65535
    .TintAndShade = 0
    .PatternTintAndShade = 0
    End With
    Columns("A:A").Select
    Selection.ClearContents
    With Selection
    .HorizontalAlignment = xlCenter
    .VerticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = False
    End With
    Columns("C:F").Select
    Selection.Delete Shift:=xlToLeft
    Columns("D:D").Select
    Selection.Delete Shift:=xlToLeft
    Columns("E:E").Select
    Selection.Delete Shift:=xlToLeft
    Columns("F:F").Select
    Selection.Delete Shift:=xlToLeft
    Columns("B:F").Select
    Range("F1").Activate
    Selection.ColumnWidth = 25
    Range("A1").Select
    Cells.Find(What:="Unsorted", After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Activate
    Rows("123:123").Select
    Range(Selection, Selection.End(xlUp)).Select
    Selection.Delete Shift:=xlUp
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("A2").Select
    ActiveCell.FormulaR1C1 = "2"
    Range("A1:A2").Select
    Selection.AutoFill Destination:=Range("A1:A500"), Type:=xlFillDefault
    Range("A1:A500").Select
    ActiveCell.SpecialCells(xlLastCell).Select
    Range(Selection, Cells(ActiveCell.Row, 1)).Select
    Range(Selection, Cells(1)).Select
    ActiveWorkbook.Worksheets("bookmarks").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("bookmarks").Sort.SortFields.Add Key:=Range( _
    "B1:B500"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
    xlSortNormal
    With ActiveWorkbook.Worksheets("bookmarks").Sort
    .SetRange Range("A1:M500")
    .Header = xlGuess
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
    End With
    ActiveCell.SpecialCells(xlLastCell).Select
    Range("B500").Select
    Selection.End(xlUp).Select
    Rows("26:26").Select
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Delete Shift:=xlUp
    ActiveCell.SpecialCells(xlLastCell).Select
    Range(Selection, Cells(ActiveCell.Row, 1)).Select
    Range(Selection, Cells(1)).Select
    ActiveWorkbook.Worksheets("bookmarks").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("bookmarks").Sort.SortFields.Add Key:=Range( _
    "A1:A500"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
    xlSortNormal
    With ActiveWorkbook.Worksheets("bookmarks").Sort
    .SetRange Range("A1:M500")
    .Header = xlGuess
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
    End With
    Columns("B:B").Select
    Selection.Cut
    Columns("G:G").Select
    Selection.Insert Shift:=xlToRight
    Range("A1").Select
    Cells.Replace What:=">", Replacement:="", LookAt:=xlPart, SearchOrder:= _
    xlByColumns, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
    Cells.Replace What:="</A", Replacement:="", LookAt:=xlPart, SearchOrder _
    :=xlByColumns, MatchCase:=False, SearchFormat:=False, ReplaceFormat:= _
    False
    Columns("B:D").Select
    With Selection.Interior
    .Pattern = xlNone
    .TintAndShade = 0
    .PatternTintAndShade = 0
    End With
    Range("A1").Select
    End Sub

  3. #3
    Registered User
    Join Date
    05-24-2011
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Macro to convert my Firefox 27.0.1 bookmarks to Excel 2010

    Here are the macros.

    It won't let me upload a .bas file? I put a .txt at the end. Just rename to remove that.

    Have to change the location for bookmarks.html in the macro also to run it.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-24-2011
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Macro to convert my Firefox 27.0.1 bookmarks to Excel 2010

    Why didn't it attach the other one? Here it is.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-24-2011
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Macro to convert my Firefox 27.0.1 bookmarks to Excel 2010

    Here's an updated version of the steps for the Macro, it works a little better:

    - - - - - - - - - - - - - - - - - - - - - - - - - - -

    File \ Open \ Desktop \ bookmarks.html
    Yes . . . Delimited . . . No Tab / Other " . . . Finish
    View / Arrange All / Horizontal / Ok
    Zoom to 80% . . . Microsoft Sans Serif . . . 10 point

    Highlight columns . . . B - G - I - K - M . . . in yellow . . . . . . M is the last column
    Clear Col A for a sort number index . . . Center the text . . . Format Cells / Custom / 000

    Delete all of the other non-yellow columns through M
    Column Width of ... B - C - D - E - F . . . to 25

    Ctrl+Home . . . Ctrl+F for: "Unsorted Bookmarks"
    It's always on row 123, unless I add bookmarks that stay there - then I'll have to re-do this macro
    There will be a long number in the URL column, right aligned, above these new URLs
    Highlight Row 123 . . . Shift+Ctrl+Arrow Up . . . Right-click / Delete

    Ctrl+Home . . . In Cells A1 and A2, put 1 and 2
    Put a sort number index in Col A, drag bottom right corner all the way to 500

    Ctrl+End . . . Shift+Home+Ctrl+Home
    Sort on Col B, the URL, to get rid of spaces

    Ctrl+Home
    Cut and Paste URLs of Col B . . . to the right of web page names
    Cut and Paste sort numbers of Col A . . . to the left of web page names
    Un-highlight all

    Ctrl+Home
    Ctrl+H . . . replace . . . > . . . and . . . </A . . . with nothing

    Ctrl+End
    Arrow Left 9 times, from Col O to Col F
    Ctrl+Arrow Up . . . Ctrl+Arrow Up . . . Ctrl+Arrow Down
    Home . . . Ctrl+Arrow Right

    STOP RECORDING: any more, or less, bookmarks than when I did the following, and it doesn't work - sort manually
    Shift+Ctrl+Arrow Up . . . Shift+Home . . . Sort on Col A, ascending . . . Ctrl+Home

    - - - - - - - - - - - - - - - - - - - - - - - - - - -

    This is what to do manually:

    Macros / Process_Bookmarks / Run

    Sort on Col D, ascending / Ctrl+Home

    Go down Col E . . . Use Ctrl + Arrow Down . . . Move some Titles from A - B - C . . . to E
    Sorting on A - B - C can make it easier to get them, if there are a lot

    Copy and Paste links to bottom of Favorites / Take a look at them to verify / Save
    Close / Don't save the Import

    Edit the bookmark Titles for special characters, or go back to the web page to get the Title of the page / then categorize
    Delete bookmarks.html on Desktop, and the Unsorted URLs in Firefox
    bookmarks.html will remain in the Recycle Bin for a day or so, in case there are any problems

    Put "Record Macro" and "Macros" in my Custom Ribbon / "New Tab"

  6. #6
    Registered User
    Join Date
    05-24-2011
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Macro to convert my Firefox 27.0.1 bookmarks to Excel 2010

    Wait, delete this last part:

    Ctrl+End
    Arrow Left 9 times, from Col O to Col F
    Ctrl+Arrow Up . . . Ctrl+Arrow Up . . . Ctrl+Arrow Down
    Home . . . Ctrl+Arrow Right

    STOP RECORDING: any more, or less, bookmarks than when I did the following, and it doesn't work - sort manually
    Shift+Ctrl+Arrow Up . . . Shift+Home . . . Sort on Col A, ascending . . . Ctrl+Home


    I just ran the macro on 10 bookmarks, and it ended up on cell D20 - that's not right.

    I think there must have been 20 bookmarks when I recorded the macro, because it ended up on cell F20.

    With these 10 Bookmarks, though, it should have ended up on cell F10.

    It looks like when I manually do Ctrl+Arrow Down . . . it retains the row number from when I recorded the macro, as opposed to acting on the current, actual data (anyone know why, or how to edit the code in the Macro?)

    Home . . . Ctrl+Arrow Right . . . Why did this work? It stayed on row 20, and stopped at the actual data in Col D - If there had been data on row 20, all the way to Col F, I believe that it would have ended up there.

    Since Ctrl+Arrow Down does not act as expected in the macro, I would like to change the last step to this (previous step shown for reference):

    Ctrl+Home
    Ctrl+H . . . replace . . . > . . . and . . . </A . . . with nothing

    Arrow right 5 times to Col F

    STOP RECORDING


    Then, part of the manual work will be to Ctrl+Arrow Down to the bottom right of the data, and then do the sort, as follows:

    Macros / Process_Bookmarks / Run

    Ctrl+Arrow Down
    Shift+Home+Ctrl+Home
    Sort on Col D, ascending . . . Ctrl+Home
    Arrow Right 4 times to Col E

    Use Ctrl+Arrow Down, to go down Col E
    . . . Move some Titles from A - B - C . . . to E
    Sorting on A - B - C can make it easier to get them, if there are a lot

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro to copy from Excel and paste into a form on IE or Firefox?
    By bshape1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-12-2014, 07:51 PM
  2. Macro to convert lowercase to uppercase upon data entry - Excel 2010
    By AnnetteB in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-23-2013, 12:23 PM
  3. How to Convert Word 2010 doc to Excel 2010 that contains several tables (one macro)
    By theglitch in forum Word Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2013, 01:36 PM
  4. Convert 2003 macro to 2010
    By pxg133 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2012, 10:40 PM
  5. Populating Word Bookmarks from Excel macro
    By ChrisMattock in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-19-2007, 08:17 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1