Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Pending Records

Hi everyone,

I have a little bit of problem with the code for pending records when
transferring to a different sheet, which can cause a serious problem.

Here is the code:

'Passing Name
Sheets("Sheet2").Range("A65000").End(xlUp).Offset( 1, 0).Value = _
Sheets("Form").Range("B3").Value

'Passing Phone #
Sheets("Sheet2").Range("B65000").End(xlUp).Offset( 1, 0).Value = _
Sheets("Form").Range("B4").Value

I use the same code different Cell in "Form" to pass the data to different
Column in "Sheet2".
The problem is if Record #1 in "Form" doesn't have Phone # when passing, the
corresponded cell in "Sheet2" will be blank too, which is fine. But Record
#2 in "Form" that has Phone #, the code pass the Phone # for Record #2 to
Record #1 because it finds that the Last blank cell is in Record#1. It
doesn't stay with Record #2 .

I hope I explain myself for this matter. Is there a way to keep every field
to stay with its own record?

Appreciate for any help.

Neon520


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Pending Records

Hi

Calculate NewRow from colum A and use it in column B

Set sh2 = Sheets("Sheet2")
NewRow = sh2.Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Row

'Passing Name
sh2.Range("A" & NewRow).Value = Sheets("Form").Range("B3").Value

'Passing Phone #
sh2.Range("B" & NewRow).Value = Sheets("Form").Range("B4").Value

Regards,
Per

"Neon520" skrev i meddelelsen
...
Hi everyone,

I have a little bit of problem with the code for pending records when
transferring to a different sheet, which can cause a serious problem.

Here is the code:

'Passing Name
Sheets("Sheet2").Range("A65000").End(xlUp).Offset( 1, 0).Value = _
Sheets("Form").Range("B3").Value

'Passing Phone #
Sheets("Sheet2").Range("B65000").End(xlUp).Offset( 1, 0).Value = _
Sheets("Form").Range("B4").Value

I use the same code different Cell in "Form" to pass the data to different
Column in "Sheet2".
The problem is if Record #1 in "Form" doesn't have Phone # when passing,
the
corresponded cell in "Sheet2" will be blank too, which is fine. But
Record
#2 in "Form" that has Phone #, the code pass the Phone # for Record #2 to
Record #1 because it finds that the Last blank cell is in Record#1. It
doesn't stay with Record #2 .

I hope I explain myself for this matter. Is there a way to keep every
field
to stay with its own record?

Appreciate for any help.

Neon520



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
Count pending issues prior to 1/15/2009 Vic Excel Discussion (Misc queries) 2 June 4th 09 02:49 PM
I need to show the last number in a rows in the total pending row Jen S New Users to Excel 2 January 30th 09 10:30 PM
Conditional Format Pending Text Input Native Excel Discussion (Misc queries) 1 January 16th 08 02:52 PM
HOW CAN I MAKE OUR PENDING SHIPMENT SHEDULE IN EXCEL? anish Excel Discussion (Misc queries) 1 December 19th 06 08:29 AM
Pre-pending and post-pending cell data in Excel David Neustadt Excel Programming 2 October 8th 03 02:53 AM


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