need Help in excel using Vb 6.0

How to generate dynamically Combobox in excel using vb 6.0

Page 1 of 1

3 Replies - 4495 Views - Last Post: 01 September 2008 - 06:49 PM Rate Topic: -----

#1 umeshshivakanth  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 25-April 08

need Help in excel using Vb 6.0

Post icon  Posted 26 August 2008 - 05:09 AM

Suppose i want 100 combo boxes in one particular column, how to generate it dynamically using vb6.0 in excel sheets and population of combo boxes with true or false option...Plz help...
Is This A Good Question/Topic? 0
  • +

Replies To: need Help in excel using Vb 6.0

#2 dineeshd  Icon User is offline

  • member icon

Reputation: 38
  • View blog
  • Posts: 619
  • Joined: 30-June 08

Re: need Help in excel using Vb 6.0

Posted 26 August 2008 - 06:07 AM

View Postumeshshivakanth, on 26 Aug, 2008 - 05:39 PM, said:

i want 100 combo boxes in one particular column

Are you sure? Why you want 100 Combo Boxes in one Column? Normally one column should contain one kind of data. So one combobox should do the job for you. Or you are trying to say something else?
Was This Post Helpful? 0
  • +
  • -

#3 umeshshivakanth  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 25-April 08

Re: need Help in excel using Vb 6.0

Posted 26 August 2008 - 08:56 PM

wat i mean is ...i want 100 combo boxes row after row in one particular column.
Hope i am clear now.
Was This Post Helpful? 0
  • +
  • -

#4 georgewba  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 04-July 08

Re: need Help in excel using Vb 6.0

Posted 01 September 2008 - 06:49 PM

This is the code for creating an excel workbook and excel worksheets and how to write anything in the sheet :
First, Excel object library must be refernced, then write this code :
Dim objExcel as Excel.Application
Set objExcel = New Excel.Application
objExcel.Visible = True
ObjExcel.SheetsInNewWorkbook = 1
ObjExcel.Workbooks.Add


This is the code for crearting an excel workbook and excel worksheets . In this part we create an excel workbook. we set how many worksheets we want in the workbook in the forth line.

The following code is for writing in the active worksheet :
with objExcel.ActiveSheet
	  .Cells(1, 2).Value = "10"
	  .Cells(2, 2).Value = "20"
	  .Cells(3, 2).Value = "SUM(B1:B2)"
	  .Range("A3")= "Total"
End With


In this part we write in the active worksheet what we want. We refer to the cell with two methods :
1. The first method by writing :
objExcel.ActiveSheet.Cells(1, 2).Value = The Text or the Formula we want , like that in Line4 in the previous example, we want to write


That is like the code in the previous example. We refer to the cell by writing the syntax like that :
objExcel.ActiveSheet.Cells([b][i]The number of the Row[/i][/b],[b][i] The number of the Column[/i][/b]).Value = The Text we want to write



2. The second by writing :
objExcel.ActiveSheet.Range("A3") = The Text we want to write


This is like the code in the previous example. we refer to the cell by writing the syntax like that :
objExcel.ActiveSheet.Range([b][i]The Name of the Cell in the Excel WorkSheet[/i][/b]) = The Text we want to write


But I don't know if whether we can write a Formula in the Cell by this syntax or not.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1