Reputation: 41
Data is in Column F.
I need to add .com/ to the beginning of the word in the cells.
Then add .JPG to the very end of every word in the cells.
In other words:
189389439
Needs to end up as:
.com/189389439.JPG
Upvotes: 1
Views: 5356
Reputation: 41
Figured it out myself:
Sub JPegMe()
Dim myCell As Range
For Each myCell In Selection
If Not IsEmpty(myCell) Then _
myCell = ".com\" & myCell & ".JPG"
Next myCell
End Sub
Upvotes: 1
Reputation: 2233
I would set on cell G1 the formula ' =".com/" & F1 & ".jpg" ' and then expand this formula to all other rows by double clicking in the right down square that appear if you select the G1 cell.
Upvotes: 0
Reputation: 2108
Does this need to be VBA
?
If you just put the formula in G1
(assuming no column header, or it would be in G2
):
=".com/" & F1 & ".JPG"
And copy this down then you will get what you need and then you can just paste special to save the values (if you need to), potentially over the original data and then delete your column G.
Upvotes: 0