Hello, I was hoping that someone might be able to help me. I have a Master work sheet that has many columns with numbers going down the columns. Inside each column, I have a picture that represents a product for that column of numbers. I have a template sheet that I run a macro that goes to the master and links all the values in the columns I choose. I want to be able to collect the picture associated withe the column that I have choosen when I run the macro and place them into postion in the template worksheet. In my template I can change the value to tell the macro what columns to pull the information from the master. I now need it to pull the pictures too and place it column C5 and D5 depending on which column pictures that I pick from the master. I hope this makes some sense and someone might be able to help me. I copied my VBA code for all 4 macros that I am using so far.
Thank you
Shane
Sub Makenewsheet()
'
' Makenewsheet Macro
' Macro recorded 06/11/2008 by smhann
'
Sheets("Template").Copy Before:=Sheets(3)
Columns("C:C").Replace What:="f", Replacement:=Range("g6").Value, LookAt:=xlPart
Range("H8").Select
Application.CutCopyMode = False
Columns("D:D").Replace What:="f", Replacement:=Range("h6").Value, LookAt:=xlPart
Sheets("Template").Select
Range("G6:H6").Select
Application.CutCopyMode = False
Selection.ClearContents
Sheets("Template (2)").Select
Range("A1").Select
End Sub
Sub Run_All()
'
' Run_All Macro
' Macro recorded 06/11/2008 by smhann
'
'
Application.Run "'Wrapper Centerline Sheet 155.xls'!Makenewsheet"
Application.Run "'Wrapper Centerline Sheet 155.xls'!hiderow155"
Application.Run "'Wrapper Centerline Sheet 155.xls'!MakeName"
End Sub
Sub hiderow155()
'
' hiderow155 Macro
' Macro recorded 11/03/2008 by shann
For Each cell In Range("k19:k193")
If cell.EntireRow.Hidden = True Then
cell.EntireRow.Hidden = False
Else
If cell.Value = "0" Then
cell.EntireRow.Hidden = True
End If
End If
Next cell
End Sub
Sub MakeName()
'
' MakeName Macro
' Macro recorded 11/09/2008 by shann
'
Range("C3:D3").Select
Selection.Copy
Range("L7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("L8").Select
Application.CutCopyMode = False
Selection.Copy
Range("L9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("L10").Select
Application.CutCopyMode = False
ActiveSheet.Name = Range("l9").Value
Range("A1").Select
End Sub
How to copy picture........ This is all I have so far but it will not go and get the picture I want depending on the columns that I choose when I run the macro from the template worksheet.
Sheets("Master").Select
Range("F5").Select
Selection.Copy
Sheets("Template").Select
Range("C5").Select
ActiveSheet.Paste
Sheets("Master").Select
Range("G5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Template").Select
Range("D5").Select
ActiveSheet.Paste
Range("A1").Select
Thank you again if you can help.
Thank you
Shane
Sub Makenewsheet()
'
' Makenewsheet Macro
' Macro recorded 06/11/2008 by smhann
'
Sheets("Template").Copy Before:=Sheets(3)
Columns("C:C").Replace What:="f", Replacement:=Range("g6").Value, LookAt:=xlPart
Range("H8").Select
Application.CutCopyMode = False
Columns("D:D").Replace What:="f", Replacement:=Range("h6").Value, LookAt:=xlPart
Sheets("Template").Select
Range("G6:H6").Select
Application.CutCopyMode = False
Selection.ClearContents
Sheets("Template (2)").Select
Range("A1").Select
End Sub
Sub Run_All()
'
' Run_All Macro
' Macro recorded 06/11/2008 by smhann
'
'
Application.Run "'Wrapper Centerline Sheet 155.xls'!Makenewsheet"
Application.Run "'Wrapper Centerline Sheet 155.xls'!hiderow155"
Application.Run "'Wrapper Centerline Sheet 155.xls'!MakeName"
End Sub
Sub hiderow155()
'
' hiderow155 Macro
' Macro recorded 11/03/2008 by shann
For Each cell In Range("k19:k193")
If cell.EntireRow.Hidden = True Then
cell.EntireRow.Hidden = False
Else
If cell.Value = "0" Then
cell.EntireRow.Hidden = True
End If
End If
Next cell
End Sub
Sub MakeName()
'
' MakeName Macro
' Macro recorded 11/09/2008 by shann
'
Range("C3:D3").Select
Selection.Copy
Range("L7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("L8").Select
Application.CutCopyMode = False
Selection.Copy
Range("L9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("L10").Select
Application.CutCopyMode = False
ActiveSheet.Name = Range("l9").Value
Range("A1").Select
End Sub
How to copy picture........ This is all I have so far but it will not go and get the picture I want depending on the columns that I choose when I run the macro from the template worksheet.
Sheets("Master").Select
Range("F5").Select
Selection.Copy
Sheets("Template").Select
Range("C5").Select
ActiveSheet.Paste
Sheets("Master").Select
Range("G5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Template").Select
Range("D5").Select
ActiveSheet.Paste
Range("A1").Select
Thank you again if you can help.