Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Loading information from a VBA project to spreadsheet

Hi

I am new to VBA and was wondering if anyone could please help me with a

problem I have been encountering.


I am making a spreadsheet for my school's drama festival.It has a small

VBA program in it which shows the user a seating plan, which is placed
on a UserForm. He/she can double-click to book it, and the program
specifies if the person is to
be an adult or child. That 'seat' on the seating plan then changes
colour - red for adult, blue for child.


But now I want this information to be uploaded into the spreadsheet -
so on the spreadsheet it will say what seats/how many seats have been
booked. Can it see how many boxes are coloured red and blue, and then
also put on the info?


Could anyone help?


Thanks so much, Jerome

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Loading information from a VBA project to spreadsheet

This may not work...

I think I'd create a worksheet (maybe hidden) that contains all the seat
id/locations in column A. Then I'd use column B to put in Adult/Child (via
code).

Since I don't have any idea how that userform works, this may not help.

After the booking agent(?) confirms the assignment (ok button?), the code would
look through that worksheet to find the correct seat and put Adult or Child in
column B (or clear the entry if the agent unassigned that seat).

dim mySeatId as string
dim mySeatTaker as string
dim res as variant
dim mySeatIdRng as range

with worksheets("seatIdlist")
set myseatidrng = .range("a2",.cells(.rows.count,"A").end(xlup))
end with

myseatid = me.combobox1.value 'or however you know the seat id.
myseattaker = 'whatever you do to put Adult/child/empty

res = application.match(myseatid,myseatidrng,0)

if iserror(res) then
'shouldn't happen
msgbox "design error--missing: " & myseatid
else
myseatidrng(res).offset(0,1).value = myseattaker
end if

========
Then you could just use
=countif()'s to count the adults, children, available.



Jerome wrote:

Hi

I am new to VBA and was wondering if anyone could please help me with a

problem I have been encountering.

I am making a spreadsheet for my school's drama festival.It has a small

VBA program in it which shows the user a seating plan, which is placed
on a UserForm. He/she can double-click to book it, and the program
specifies if the person is to
be an adult or child. That 'seat' on the seating plan then changes
colour - red for adult, blue for child.

But now I want this information to be uploaded into the spreadsheet -
so on the spreadsheet it will say what seats/how many seats have been
booked. Can it see how many boxes are coloured red and blue, and then
also put on the info?

Could anyone help?

Thanks so much, Jerome


--

Dave Peterson
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
project information into other cells hot dogs Excel Discussion (Misc queries) 1 September 12th 06 12:45 PM
Loading a calendar (user form) from another project (personal.xls) Ollie[_2_] Excel Programming 1 September 25th 05 09:33 PM
Loading a spreadsheet from memory Peter Hurford Excel Programming 9 June 7th 05 11:22 AM
Excel macro to extract information from MS project files zouzou Excel Programming 2 August 13th 04 01:03 PM
Loading Add-ins to a Protected Project David G Stevens Excel Programming 2 September 8th 03 08:59 AM


All times are GMT +1. The time now is 06:30 PM.

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"