How to use the Camera Icon Tool using a Macro?

all4excel

Active Member
Joined
Feb 15, 2008
Messages
435
How to use the Camera Icon Tool using a Macro?

I want to copy the First Row which is the Column heading of one Sheet to a different Sheet
Example :
From Col A till Col G First Row is to be copied as an Image..
Normally I do it using the Camera Icon, however when I tried recording a Macro for the same it did not work..

So how do I that if I provide the Start Column and End Column Alphabet as a Variable is that possible..
I want this Image to not remain Volatile which is the case using the Camera Tool..

So, how do i get the picture of only the first row or any row and store it is an Image in a different sheet as static picture so that even when the sheet is moved to a different location it does not make a difference to the Image.

Thanks in advance..
 
You should not have any problem if wsR is the active sheet. Otherwise, use
Code:
[FONT="Consolas"][SIZE="2"][COLOR="Navy"]With wsR.Range(wsR.Cells(1, i), wsR.Cells(1, j))[/COLOR][/SIZE][/FONT]
You may remove the With and End With statements, and use
Code:
[FONT="Consolas"][SIZE="2"][COLOR="Navy"]For Each r In wsR.Range(wsR.Cells(1, i), wsR.Cells(1, j))[/COLOR][/SIZE][/FONT]
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Thanks for the clarification I spent the entire afternoon pondering was there any mistake in the line but as you mentioned it needs to be the Active Sheet, which it wasn't and therefore the error was thrown..

Thanks and finally I conclude this thread extremely happy and satisfied..
Your perseverance has really helped me in not onl getting such customized solutions but also enriched my VBA knowledge to some extent..

Thanks again dear brother..

Al-Humdallah...

God Bless
 
Upvote 0
Hey Brother, sorry to dig old threads back..

But I just realized that I made a slight conceptual mistake in keeping the Column Width for the display Columns which houses the formatting info slightly more than the Maximum width of the largest column size in the Parent Sheet..

Rather I realize now, that it should have been made to a size which is bigger than the Camera Image for the respective column which it's going to display rather that my initial request which considered the Maximum of all the columns in contention from the Parent SHeet and then making it slightly wider than that size..

It would be better that I keep the Column Width flexible in such a way that the Reduced Image fits in as per the Filled Column AutoFit Size...
So all Columns wont have the same size and though they would not look uniform but they would have proper spacing in respect to the text as well as the Image in the second row.

Please suggest..

I am getting confused as to what should be done first as we have already reduced the Image Size, first preference is to keep it wider than the Image but for each Image for the specific column.

Thanks and Regards
all4excel

Al-Humdallah.
 
Upvote 0
Hey Brother I think I managed it, with slight changes in the code..
But humble request if you could assist me on my other query to capture two images in a comment..
Please see the link where I had received help earlier where getting one Dynamic Picture Link is possible..

Thanks in advance.

Al-Humdallah
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,465
Members
448,965
Latest member
grijken

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top