LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Using enumeration with controls

I have some code here in a for next loop.
I want to build a string that uses the enumeration to take calues from 9 rows
of three comboboxes: M1, D1 and Y1 (Month, Day and Year)
Then I want it to pull from M2, D2 and Y2

Unfortunately its printing the actual string "Me.Combobox1.Value" into the cell
ranges as opposed to the value in the comboboxes.

This is what the actual cells look like:

Me.M1.value Me.D1.value Me.Y1.value
Me.M2.value Me.D2.value Me.Y2.value
Me.M3.value Me.D3.value Me.Y3.value
Me.M4.value Me.D4.value Me.Y4.value


Anyone know a way around this? It could really come in handy:


Dim i As Integer
Dim S1 As String, S2 As String, S3 As String

For i = 1 To 9

S1 = "Me.M" & i & ".value"
S2 = "Me.D" & i & ".value"
S3 = "Me.Y" & i & ".value"
MonthCol = Sheets(1).Range("B1000").End(xlUp).Row + 1
DayCol = Sheets(1).Range("C1000").End(xlUp).Row + 1
YearCol = Sheets(1).Range("D1000").End(xlUp).Row + 1

Cells(MonthCol, 2).Value = S1 'Me.M1.Value
Cells(DayCol, 3).Value = S2 'Me.D1.Value
Cells(YearCol, 4).Value = S3 'Me.Y1.Value

Next i

Jim Stiene



 
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
enumeration members adewole Excel Worksheet Functions 1 June 14th 07 06:38 PM
using gui controls daddy260 Excel Discussion (Misc queries) 4 May 25th 07 07:35 AM
ActiveX controls Luke Excel Discussion (Misc queries) 1 October 26th 06 02:00 PM
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM
Dimming Controls David Benson[_2_] Excel Programming 1 October 10th 03 09:49 PM


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