Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Linking 2 worksheets-Empty cell problem | Excel Discussion (Misc queries) | |||
problem of an empty cell | Excel Discussion (Misc queries) | |||
Dropping the cell in the empty cell by formula | Excel Discussion (Misc queries) | |||
Macro code for dropping to next empty cell | Excel Discussion (Misc queries) | |||
Copied empty cells, give sorting problem in Data sheet | Excel Programming |