Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 21st, 2013, 12:57 PM
Registered User
 
Join Date: Mar 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Defining a sheet from a combobox to determine which sheet the info is added to

i developed this sheet a while back just to record information however the list has become quite cumbersome so i want to change the way it adds data using a combobox to specify which sheet the data goes into (months) rather than all in one and im not quite sure how to adjust my code to do this.. im currently using

Private Sub cmbAdd_Click()
'next empty cell in column A
Set c = Range("a65536").End(xlUp).Offset(1, 0)
Application.ScreenUpdating = False 'speed up, hide task
'write userform entries to database
With Me
c.Value = .ComboBox1.Value 'column one is first name
c.Offset(0, 1).Value = .TextBox3.Value 'column 3 is department
ClearControls 'clear the form
End With
Application.ScreenUpdating = True 'updatescreen
End Sub

i ws thinking something like set c =range(combobox2.value!"a65536"...however i cant get it to work

any help would be great
 
Old June 21st, 2013, 09:48 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

Can you try something like this

Code:
 
    Set oWS = Worksheets(ComboBox1.Value)
    oWS.Range("a65536").Value = "Ram"
Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
help in how to copy macro in new added sheet zmhnk Excel VBA 1 April 9th, 2012 10:22 PM
Need a Macro for Compare and copy data from one sheet to another sheet in Excel. katnam21 Excel VBA 1 January 29th, 2012 12:09 PM
Open Workbook,Copy Sheet,Move Sheet, Close/Save ptrussell2009 Excel VBA 0 June 13th, 2008 02:28 PM
access function in data sheet(another sheet) jani Excel VBA 1 May 21st, 2008 07:15 PM
Determine the number of data rows in a sheet ashu_gupta75 Excel VBA 1 July 31st, 2004 03:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.