Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dav
 
Posts: n/a
Default Inserting pictures then sorting


I have a sheet containing data in the first few columns then a column
containing references to pictures. Can these pictures be imported into
the cell next to the reference eg data is in columns A & B a reference
to a picture in columnC. If the pictures refered to in column C can be
imported into column D.

I can then sort by the data in columns A & B and print out the pictures
I am interested in.

Obviously this is a simplified version of what I require as there are
hundreds of lines of data but hopefully you will get the picture. I
could use file insert picture, but this would be highly time consuming
and hopefully the task can be automated with a macro, but I am fairly
new to writing macros




If anyone could help that would be great

Thanks :)

Dav


+-------------------------------------------------------------------+
|Filename: Example.txt |
|Download: http://www.excelforum.com/attachment.php?postid=3982 |
+-------------------------------------------------------------------+

--
Dav
------------------------------------------------------------------------
Dav's Profile: http://www.excelforum.com/member.php...o&userid=27107
View this thread: http://www.excelforum.com/showthread...hreadid=480860

  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default Inserting pictures then sorting

Something like this might work for you:

Option Explicit
Sub testme01()

Dim testStr As String
Dim myCell As Range
Dim myRng As Range
Dim wks As Worksheet
Dim myPict As Picture

Set wks = Worksheets("sheet1")

With wks
.Pictures.Delete 'nice for testing.
Set myRng = .Range("c2", .Cells(.Rows.Count, "C").End(xlUp))
End With

For Each myCell In myRng.Cells
testStr = ""
On Error Resume Next
testStr = Dir(myCell.Value)
On Error GoTo 0

If testStr = "" Then
myCell.Offset(0, 1).Value = "Picture not found"
Else
With myCell.Offset(0, 1)
.ClearContents
Set myPict = .Parent.Pictures.Insert(myCell.Value)
myPict.Top = .Top
myPict.Left = .Left
myPict.Width = .Width
myPict.Height = .Height
myPict.Placement = xlMoveAndSize
End With
End If
Next myCell
End Sub


Dav wrote:

I have a sheet containing data in the first few columns then a column
containing references to pictures. Can these pictures be imported into
the cell next to the reference eg data is in columns A & B a reference
to a picture in columnC. If the pictures refered to in column C can be
imported into column D.

I can then sort by the data in columns A & B and print out the pictures
I am interested in.

Obviously this is a simplified version of what I require as there are
hundreds of lines of data but hopefully you will get the picture. I
could use file insert picture, but this would be highly time consuming
and hopefully the task can be automated with a macro, but I am fairly
new to writing macros

If anyone could help that would be great

Thanks :)

Dav

+-------------------------------------------------------------------+
|Filename: Example.txt |
|Download: http://www.excelforum.com/attachment.php?postid=3982 |
+-------------------------------------------------------------------+

--
Dav
------------------------------------------------------------------------
Dav's Profile: http://www.excelforum.com/member.php...o&userid=27107
View this thread: http://www.excelforum.com/showthread...hreadid=480860


--

Dave Peterson
  #3   Report Post  
Dav
 
Posts: n/a
Default Inserting pictures then sorting


:) That has saved a colleague a huge amount of work and will greatly add
value to our survey process as pictures of handwritten text can be
included with parts of the survey. Its made my day!

Dav


--
Dav
------------------------------------------------------------------------
Dav's Profile: http://www.excelforum.com/member.php...o&userid=27107
View this thread: http://www.excelforum.com/showthread...hreadid=480860

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
McGimpsey's Disappearing Pictures PW11111 Excel Discussion (Misc queries) 1 October 10th 05 03:52 PM
Inserting Pictures in a protected worsheet Batti69 Excel Worksheet Functions 0 September 19th 05 05:11 PM
Inserting Pictures with IF function DrewNov Excel Worksheet Functions 0 August 25th 05 07:58 PM
inserting pictures in a workbook TCB Excel Discussion (Misc queries) 1 May 31st 05 12:54 PM
Worksheet Protection and Inserting Pictures Hood Excel Discussion (Misc queries) 1 February 3rd 05 09:53 PM


All times are GMT +1. The time now is 04:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"