Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Stupid question - Put a value in a cell?

I'm running a routine that searches through an array to find a value. If it
finds it, it creates another routine that pastes certain values into another
sheet.

All I want to do is, if it finds those values, I want to put an "X" into
certain cells on another sheet. See, I said it was a stupid question. ;)
But, as a novice, it really has me stumped.

Thanks!
Shawn


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Stupid question - Put a value in a cell?

Hi
best way: post your existing code so one can adapt/change this :-)


--
Regards
Frank Kabel
Frankfurt, Germany


43fan wrote:
I'm running a routine that searches through an array to find a value.
If it finds it, it creates another routine that pastes certain values
into another sheet.

All I want to do is, if it finds those values, I want to put an "X"
into certain cells on another sheet. See, I said it was a stupid
question. ;) But, as a novice, it really has me stumped.

Thanks!
Shawn


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Stupid question - Put a value in a cell?

Frank,

I can do that, no prob., in fact it'll be posted below. But, basically, how
to you just insert a value in a field?

Here's the code:(initially gotten from here, then modified) :)

Set Myrange = Intersect(ActiveSheet.UsedRange, Columns("B"))
If Myrange Is Nothing Then Exit Sub
Application.ScreenUpdating = False
FindRange = Array("MLAP")
For Each elem In FindRange
Set C = Myrange.Find(elem, Myrange.Cells(1), xlValues, xlPart)
If C Is Nothing Then Exit Sub
VehicleCell = "$A$" & Trim(Str(C.Row))
If Not C Is Nothing Then
If CopyRange Is Nothing Then Set CopyRange = Range(VehicleCell)
firstaddress = C.Address
Do
Set C = Myrange.FindNext(C)
VehicleCell = "$A$" & Trim(Str(C.Row))
Set CopyRange = Union(CopyRange, Range(VehicleCell))
Loop While firstaddress < C.Address
End If
Next
Application.ScreenUpdating = True
If CopyRange Is Nothing Then Exit Sub
CopyRange.Copy

Sheets("Monday - Garage").Select
Range("A12").Select
ActiveSheet.Paste
Range("A26").Select
ActiveSheet.Paste

--------
This part all works fine and does what I want to do. Now that it's "found"
the values, I want to put an X in cells D12.... actually, just had another
thought. Since the values may be found in multiple cells throughout, I need
to put X's in multiple rows as well. There may be say 5 instances,
CopyRange has all five vehicle numbers in it, and gets pasted where it needs
to be. I guess what I need to do is somehow make CopyRange equal to the
vehicle number, plus the X's it needs? Can CopyRange be Vehicle number +
two empty cells, plus X, empty cell, then X, etc, etc.?

Not sure if I've explained this well or not, but I'm heading back to try
making CopyRange equal to everything I need. :)

Cells(D, 12) = "X"

"Frank Kabel" wrote in message
...
Hi
best way: post your existing code so one can adapt/change this :-)


--
Regards
Frank Kabel
Frankfurt, Germany


43fan wrote:
I'm running a routine that searches through an array to find a value.
If it finds it, it creates another routine that pastes certain values
into another sheet.

All I want to do is, if it finds those values, I want to put an "X"
into certain cells on another sheet. See, I said it was a stupid
question. ;) But, as a novice, it really has me stumped.

Thanks!
Shawn




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Stupid question - Put a value in a cell?

Hi
to insert a value use something like
with range("B1")
.value="your_value"
end with

--
Regards
Frank Kabel
Frankfurt, Germany


43fan wrote:
Frank,

I can do that, no prob., in fact it'll be posted below. But,
basically, how to you just insert a value in a field?

Here's the code:(initially gotten from here, then modified) :)

Set Myrange = Intersect(ActiveSheet.UsedRange, Columns("B"))
If Myrange Is Nothing Then Exit Sub
Application.ScreenUpdating = False
FindRange = Array("MLAP")
For Each elem In FindRange
Set C = Myrange.Find(elem, Myrange.Cells(1), xlValues, xlPart)
If C Is Nothing Then Exit Sub
VehicleCell = "$A$" & Trim(Str(C.Row))
If Not C Is Nothing Then
If CopyRange Is Nothing Then Set CopyRange = Range(VehicleCell)
firstaddress = C.Address
Do
Set C = Myrange.FindNext(C)
VehicleCell = "$A$" & Trim(Str(C.Row))
Set CopyRange = Union(CopyRange, Range(VehicleCell))
Loop While firstaddress < C.Address
End If
Next
Application.ScreenUpdating = True
If CopyRange Is Nothing Then Exit Sub
CopyRange.Copy

Sheets("Monday - Garage").Select
Range("A12").Select
ActiveSheet.Paste
Range("A26").Select
ActiveSheet.Paste

--------
This part all works fine and does what I want to do. Now that it's
"found" the values, I want to put an X in cells D12.... actually,
just had another thought. Since the values may be found in multiple
cells throughout, I need to put X's in multiple rows as well. There
may be say 5 instances, CopyRange has all five vehicle numbers in it,
and gets pasted where it needs to be. I guess what I need to do is
somehow make CopyRange equal to the vehicle number, plus the X's it
needs? Can CopyRange be Vehicle number + two empty cells, plus X,
empty cell, then X, etc, etc.?

Not sure if I've explained this well or not, but I'm heading back to
try making CopyRange equal to everything I need. :)

Cells(D, 12) = "X"

"Frank Kabel" wrote in message
...
Hi
best way: post your existing code so one can adapt/change this :-)


--
Regards
Frank Kabel
Frankfurt, Germany


43fan wrote:
I'm running a routine that searches through an array to find a
value. If it finds it, it creates another routine that pastes
certain values into another sheet.

All I want to do is, if it finds those values, I want to put an "X"
into certain cells on another sheet. See, I said it was a stupid
question. ;) But, as a novice, it really has me stumped.

Thanks!
Shawn


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
big stupid question Wu Excel Discussion (Misc queries) 4 May 17th 08 05:33 PM
Stupid Question Justin Kreamer Excel Discussion (Misc queries) 1 May 2nd 08 07:47 AM
Probably a Stupid Question Paige Excel Discussion (Misc queries) 10 February 4th 08 06:52 PM
stupid question Kimberly New Users to Excel 4 May 18th 07 08:55 PM
Stupid Question mastermind Excel Worksheet Functions 1 August 5th 06 07:03 PM


All times are GMT +1. The time now is 08:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"