Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 4th, 2012, 03:20 PM
smasood smasood is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 1 smasood User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 5 m 42 sec
Reputation Power: 0
Using Variables with Range

Hi guys,
I'm sorry I am really new to Visual Basic. What I would like to do is basically access information from a different sheet and using if statements, fill in the original sheet. I want to loop the program so it keeps running till sheet2 is empty. This is what I have so far:

Sub Region_Code_check()
'
' Region_Code_check Macro
' Checks Region_Code from differences folder and sets the delivery_channel_id accordingly.
'
' Keyboard Shortcut: Ctrl+Shift+R



If ThisWorkbook.Sheets(8).Range("A1") = "RSHIP" Then
ActiveSheet.Cells(ActiveCell.row, 3).Select
ActiveCell.FormulaR1C1 = 1
Call Delivery_Point_Name
ElseIf ThisWorkbook.Sheets(8).Range("A1") = "CH" Then
ActiveSheet.Cells(ActiveCell.row, 3).Select
ActiveCell.FormulaR1C1 = 1
ElseIf ThisWorkbook.Sheets(8).Range("A1") = "CRHA" Then
ActiveSheet.Cells(ActiveCell.row, 3).Select
ActiveCell.FormulaR1C1 = 2
ElseIf ThisWorkbook.Sheets(8).Range("A1") = "CSC" Then
ActiveSheet.Cells(ActiveCell.row, 3).Select
ActiveCell.FormulaR1C1 = 3
Else
MsgBox ("Invalid Data")

End If




End Sub

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Using Variables with Range

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap