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

Okay I am having some trouble writng a code that takes a value from
Range("k3") and then searches a set Range("J10:J34,L10:L34") for the
first blank cell. When the first blank cell is determined the code
will need to initialize the cell with a name, and then move over
(right) one column and insert the value taken from Range("k3"). Does
anyone have any idea how this can be accomplished?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Macro Problems

Hi Mastermind,

Try:

'=============
Public Sub Tester002()
Dim SH As Worksheet
Dim Rng As Range
Dim Rng2 As Range
Const sStr As String = "Your_Name" '<<==== CHANGE

Set SH = ActiveSheet '<<==== CHANGE
Set Rng = SH.Range("J10:J34, L10:L34")

On Error Resume Next
Set Rng2 = Rng.SpecialCells(xlCellTypeBlanks)
On Error GoTo 0

If Not Rng2 Is Nothing Then
With Rng2(1)
.Name = sStr
.Offset(0, 1).Value = SH.Range("K3").Value
End With
End If
End Sub
'<<=============


---
Regards,
Norman


"mastermind" wrote in message
oups.com...
Okay I am having some trouble writng a code that takes a value from
Range("k3") and then searches a set Range("J10:J34,L10:L34") for the
first blank cell. When the first blank cell is determined the code
will need to initialize the cell with a name, and then move over
(right) one column and insert the value taken from Range("k3"). Does
anyone have any idea how this can be accomplished?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Macro Problems

Thank you on behalf of Mastermind
--
Robert



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
Macro Problems curlydave Excel Programming 0 February 1st 06 12:25 AM
macro problems John Garate Excel Programming 1 January 12th 05 09:34 AM
various macro problems legepe[_12_] Excel Programming 0 October 23rd 04 11:07 PM
various macro problems legepe[_11_] Excel Programming 1 October 23rd 04 09:59 PM
macro problems Peter Wiley Excel Programming 2 September 10th 03 09:53 PM


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