Announcement

Collapse
No announcement yet.

Add .jpg to all cells

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Add .jpg to all cells

    Hi, I have an Excel wookbook file with 1 column and 800 cells. I need to add .jpg to the and of the word in all cells. How can i do it fast with out copy past? Thanks in advance Moshe

  • #2
    Re: Add .jpg to all cells

    Assuming your data is in column A from A1 downwards:
    Sub AmendCell()
    '
    ' AmendCell Macro
    '

    Range("A1").Select
    ' Set Do loop to stop when an empty cell is reached.
    Do Until IsEmpty(ActiveCell)
    ActiveCell.Value = ActiveCell.Value & ".jpg"
    ActiveCell.Offset(1, 0).Select
    Loop
    End Sub
    Edit "Range(A1).Select" to suit your spreadsheet
    Tom Jones
    MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
    PhD, MSc, FIAP, MIITT
    IT Trainer / Consultant
    Ossian Ltd
    Scotland

    ** Remember to give credit where credit is due and leave reputation points where appropriate **

    Comment


    • #3
      Re: Add .jpg to all cells

      Hi, Thanks for he replay but, i didn't understand anything

      Comment


      • #4
        Re: Add .jpg to all cells

        You create a macro in Excel to loop through all the cells in the column
        Tom Jones
        MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
        PhD, MSc, FIAP, MIITT
        IT Trainer / Consultant
        Ossian Ltd
        Scotland

        ** Remember to give credit where credit is due and leave reputation points where appropriate **

        Comment


        • #5
          Re: Add .jpg to all cells

          And don't forget to Enable Macros in Excel.
          1 1 was a racehorse.
          2 2 was 1 2.
          1 1 1 1 race 1 day,
          2 2 1 1 2

          Comment


          • #6
            Re: Add .jpg to all cells

            I'm very bad in Excel so, I don't know how to do this.
            Is there a simple way to fo this like with insert function?

            Moshe

            Comment


            • #7
              Re: Add .jpg to all cells

              Originally posted by moshiko View Post
              I'm very bad in Excel so, I don't know how to do this.
              Is there a simple way to fo this like with insert function?

              Moshe
              It's really quite simple. Go to Tools > Macros and start recording a new Macro to create a base. You can stop the recording immediately. Now press Alt+F8 and you will get a list of your macros. Select the macro you just recorded and replace all of the text in it with what Ossian gave you.

              Once that's done you can run your macro and your changes should be reflected.

              Comment

              Working...
              X