updating spreadsheet

  • Thread starter Thread starter tiptop
  • Start date Start date
T

tiptop

Hello all, I have a quick question. I have a spreadsheet that I nee
to have remain open in the background of another spreadsheet. I nee
to create a code that will take the info from a1 of the mai
spreadsheet and input it in a1 of the background spreadsheet. Th
tricky part that I can't figure out, is that if a1 on the backgroun
already has something typed in it, then I need it to put the info i
a2, so on and so forth. The background sheet is going to be updated o
a minute by minute basis.

IE.

SheetA.xls (in the background)
SheetB.xls (main screen)

MacroA takes the info from SheetB Cell A1 and puts it in SheetA Cell A
only if it's empty. If it has something in it already, then it need
to put it in SheetA Cell A2.

Any Ideas???

Thanks for all the help!
 
Hi Tiptop,

First Case- Value to be entered in Cell A1 if empty, otherwise in cell A2:

Set rng1 = IIf(IsEmpty(ws1.Range("A1")), ws1.Range("A1"), ws1.Range("A2"))

-----------------------------------

Second Case - Value to be entered in Cell A1 if empty, otherwise in first
blank cell in column A:

Set NextCell =ws1.Cells(Rows.Count, "A").End(xlUp)(2)
Set rng1 = IIf(IsEmpty(ws1.Range("A1")), ws1.Range("A1"), NextCell)
 
I'm a little bit lost. The 2nd case is most likely what I will need t
use. But, I can't figure out how to put it in my code. Below is kin
of where I am at...

Sub ProcessedExceptions()
ChDir "C:\Documents and Settings\Administrator\Desktop"
Workbooks.Open Filename:= _
"C:\Documents and Settings\Administrator\Desktop\Processe
Exceptions.xls"
ActiveWindow.WindowState = xlMinimized
Workbooks("Online Exceptions.xls").Activate
End Sub

Basically, for example. The info that is in (Online Exceptions.xls
cell S13) needs to be entered in file (Processed Exceptions.xls, Cel
A1, A2....). I'm trying to make life a little easier and tree friendl
at work...I process these exceptions roughly 700-900 exceptions a da
(each on an individual sheet of paper) so this will make my life a LO
easier if I can figure out the correct code. Thanks again for all th
help!
 
Hi TipTop,

In the absence of more concrete detail, perhaps the following routine will
enable you to progress your project. In its present incarnation, the routine
is run once the requisite cells in the Online Exceptions worksheet have
been selected manually. Depending on the intracasies of your operation,
you may well be able to automate this step.Presumably the first row in the
Exceptions worksheet will constitute a header row. The routine will copy
your data to the first blank cell(s) in column A below your header.

Sub Test()
Dim WS As Worksheet
Dim sourceRng As Range, destRng As Range

Set sourceRng = Selection
Set WS = Workbooks("Processed Exceptions.xls").Sheets("Sheet1")
Set destRng = WS.Cells(Rows.Count, "A").End(xlUp)(2)

sourceRng.Copy destRng

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top