#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Blank Cell

Please help

I have data in a worksheet called "dm1" in cell "a72", cell "aa73"
Now when i click a button i want contents of "a72" to go to a worksheet
named "Input Screen" and find a blank cell between "d7:d36" and place the
data here.
Now "aa73" goes to "Input Screen" and find a blank cell between "e7:e36" and
place the data here.

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Blank Cell

Hi, you could try something like (eg for first Write):
'-----------------------------------------------------
Sub test()
Dim rg As Range, Cell As Range

Set Cell = ThisWorkbook.Worksheets("dm1").Range("a72")
Set rg = ThisWorkbook.Worksheets("Input Screen").Range("d7:d36")

Set rg = rg.Find(Chr(0), , xlValues, xlWhole) 'search blank cell
If rg Is Nothing Then 'If no blank cell found
MsgBox "No blank cell found"
Else 'else write the cell
rg.Cells(1).Value = Cell.Value
End If

End Sub
'------------------------------------------------------------
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"cityfc" wrote:

Please help

I have data in a worksheet called "dm1" in cell "a72", cell "aa73"
Now when i click a button i want contents of "a72" to go to a worksheet
named "Input Screen" and find a blank cell between "d7:d36" and place the
data here.
Now "aa73" goes to "Input Screen" and find a blank cell between "e7:e36" and
place the data here.

Thanks in advance

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Blank Cell

What a star
thank you so much it works a treat

cityfc



"sebastienm" wrote:

Hi, you could try something like (eg for first Write):
'-----------------------------------------------------
Sub test()
Dim rg As Range, Cell As Range

Set Cell = ThisWorkbook.Worksheets("dm1").Range("a72")
Set rg = ThisWorkbook.Worksheets("Input Screen").Range("d7:d36")

Set rg = rg.Find(Chr(0), , xlValues, xlWhole) 'search blank cell
If rg Is Nothing Then 'If no blank cell found
MsgBox "No blank cell found"
Else 'else write the cell
rg.Cells(1).Value = Cell.Value
End If

End Sub
'------------------------------------------------------------
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"cityfc" wrote:

Please help

I have data in a worksheet called "dm1" in cell "a72", cell "aa73"
Now when i click a button i want contents of "a72" to go to a worksheet
named "Input Screen" and find a blank cell between "d7:d36" and place the
data here.
Now "aa73" goes to "Input Screen" and find a blank cell between "e7:e36" and
place the data here.

Thanks in advance

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
How to return a blank formula cell if the reference is blank? waybomb Excel Worksheet Functions 2 January 22nd 09 05:53 PM
Average Formula to display blank cell if named range is blank Rachael F Excel Worksheet Functions 3 February 22nd 08 05:05 PM
how to get excel to display blank if reference cell blank silent1(not) Excel Worksheet Functions 1 December 2nd 05 02:49 PM
How do I make a blank cell with a date format blank? Pivot Table/Query Excel Worksheet Functions 6 June 14th 05 11:19 PM
COPY A CONCATENATE CELL TO BLANK CELL PUTTING IN THE NEXT BLANK C. QUEST41067 Excel Discussion (Misc queries) 1 January 15th 05 09:29 PM


All times are GMT +1. The time now is 01:50 PM.

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"