Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Problem Dropping data in first Empty Cell and across the row

Hi All,

I have spent all weekend trying to debug what's wrong with my code. I find
the first empty cell and dorp the current date and the other data across
current row. The problem I have is when I click the calc button again, it
drops the date but placed the other data on other rows.

Below is my code. I tried evrything. Does the formatting affect the rest
of the code Offset. It must be simple that I miss it.

Any help is great ly appreciated. Thanks.

Sub RXWaterLog() €˜Macro to start at Column 1 Row 3 find empty cell and add
data
Dim Today
Today = Now ' Assign current system date and time.
Dim MyCellCell As Range

With Worksheets("ICON Data Log")

If IsEmpty(.Cells(3, 1)) Then
Set MyCellCell = .Cells(3, 1)
ElseIf IsEmpty(.Cells(3 + 1, 1)) Then
Set MyCellCell = .Cells(3 + 1, 1)
Else


Set MyCellCell = .Cells(3, 1).End(xlDown).Offset(1, 0)
End If
MyCellValue = Today

End With

'System Data

ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = " Water"

With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Locked = True
Selection.FormulaHidden = False
Selection.FormulaHidden = False


'Chromium

'With Workheets("ICON Data Log")
ActiveCell.Offset(0, 1).Activate
ActiveCell.Formula = "=IF(OR('Reactor Water'!F12=""Cr"",'Reactor
Water'!F13=""Cr""),LOOKUP(""B"",'Reactor Water'!F12:F13:'Reactor
Water'!G12:G13),0)"
'End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
'.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Locked = True
Selection.FormulaHidden = False'
End Sub



Ligaya














  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Problem Dropping data in first Empty Cell and across the row


Hi,

1. 'MyCellValue = Today' ? Should it not be MyCellCell.Value = Today?

2. Further just after above line, add MyCellCell.Select
Because later you start with ActiveCell.Offset, so the activecell
should be MyCellCell. Therefore you first select it as above.

Sharad



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Problem Dropping data in first Empty Cell and across the row



"Sharad" wrote:


Hi,

1. 'MyCellValue = Today' ? Should it not be MyCellCell.Value = Today?

2. Further just after above line, add MyCellCell.Select
Because later you start with ActiveCell.Offset, so the activecell
should be MyCellCell. Therefore you first select it as above.

Sharad



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Sharad.

Thanks. I'll make corrections and run it again.

Regards.

Ligaya
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
Linking 2 worksheets-Empty cell problem NM Excel Discussion (Misc queries) 4 October 1st 08 02:50 PM
problem of an empty cell octet Excel Discussion (Misc queries) 5 September 3rd 08 05:16 PM
Dropping the cell in the empty cell by formula xgunda420x Excel Discussion (Misc queries) 0 February 1st 06 07:11 PM
Macro code for dropping to next empty cell JB2010 Excel Discussion (Misc queries) 4 November 3rd 05 01:35 PM
Copied empty cells, give sorting problem in Data sheet Ruud[_2_] Excel Programming 0 September 16th 04 04:44 AM


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