Excel VB code
Excel VB code
Excel VB code
Excel VB code
Excel VB code
Excel VB code Excel VB code Excel VB code Excel VB code Excel VB code Excel VB code Excel VB code Excel VB code
Excel VB code Excel VB code
Excel VB code
Go Back  Xtreme Visual Basic Talk > > > Excel VB code


Reply
 
Thread Tools Display Modes
  #1  
Old 01-04-2012, 07:45 AM
singhg8 singhg8 is offline
Newcomer
 
Join Date: Dec 2011
Posts: 7
Default Excel VB code


Hi,

I am trying to write a code for excel so that it generates results in the last empty column on the sheet. below is a sample data of what is there:

# Category Request time
1 Chrysalis 04/01/2012 11:39
2 Printers 04/01/2012 11:28

And the result I wish to achieve is as below:

# Category Request time Allocated To
1 Chrysalis 04/01/2012 11:39 John
2 Printers 04/01/2012 11:28 Paul

I would be grateful if anyone could help me with the code please.


thanks
Reply With Quote
  #2  
Old 01-04-2012, 09:36 AM
Gruff's Avatar
GruffExcel VB code Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

Do the headers "Category Request Time and Allocated to" exist at row 1?

Depending on the version of Excel you are using there are several ways to get the last used cell in a column.

Code:
Dim LastRow as Integer LastRow=ExcelSheet.Range("C65536").End(xlUp).Row

Will return the last used Row for column C.
Increase the found value by 1 to get the next empty row.

Columns may be refered to by number as well as letters. C would be 3.

Cells(LastRow+1, 3) = UserName.
__________________
Burn the land and boil the sea
You can't take the sky from me


~T
Reply With Quote
  #3  
Old 01-05-2012, 02:15 AM
singhg8 singhg8 is offline
Newcomer
 
Join Date: Dec 2011
Posts: 7
Default

Sorry i am a very new to coding, so will appreciate if you can help me a bit further. The version of excel is 2003. I am using the If-End If statement.

Can you elaborate on the code contents more please? Will be very grateful.
Reply With Quote
  #4  
Old 01-05-2012, 03:38 PM
Gruff's Avatar
GruffExcel VB code Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

Can't do much without seeing your code snippit.
Otherwise I'm just wildly guessing.
__________________
Burn the land and boil the sea
You can't take the sky from me


~T
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Excel VB code
Excel VB code
Excel VB code Excel VB code
Excel VB code
Excel VB code
Excel VB code Excel VB code Excel VB code Excel VB code Excel VB code Excel VB code Excel VB code
Excel VB code
Excel VB code
 
Excel VB code
Excel VB code
 
-->