Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Bob is offline
external usenet poster
 
Posts: 972
Default reading database and filling excel

Hi,

I'm trying to read from SQL server and create a Excel report from it. I can
do this by exporting data function. However I need to place up to 3 clip arts
in the first column on this report based on the condition in the another
cells and also change the background color for the entire row.
I can insert the image, but I have problem with resizing the cell based on
the images and also checking to see if the ccell already have the image then
do not insert again.
Here is my code I used so far:

Sub Macro1()
'
Dim TotalRows As Integer

TotalRows = ActiveSheet.UsedRange.Rows.Count
For i = 1 To TotalRows
If Range("C" & (i + 4)) = "Y" Then
ActiveSheet.Shapes("Picture 1").Select
Selection.Copy
Range("A" & (i + 4)).Select
ActiveSheet.Paste
' Selection.Rows.AutoFit
' Selection.Columns.AutoFit
For Each sht In ActiveWorkbook.Worksheets
sht.Columns("A:A").EntireColumn.AutoFit
Next sht
End If
Next
I would appreciate your feed back on this issue.

Regards,
Bob
End Sub
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
Update Excel Database via Access Main Database with a script Finnbar New Users to Excel 2 November 3rd 08 07:24 PM
reading database value into a cell Xabi Excel Programming 2 October 28th 04 02:12 PM
Filling Database Query stuph[_3_] Excel Programming 1 September 1st 04 05:29 PM
Reading data from a database Richard Buttrey Excel Programming 1 August 13th 04 03:13 PM
Reading with ADO from Access database over network onedaywhen Excel Programming 1 April 2nd 04 12:29 PM


All times are GMT +1. The time now is 04:15 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"