在Excel中基于“其他”更改一个单元格的值

时间:2016-04-04 12:51:21

标签: excel vba excel-vba

我是Excel和VBA的新手。我正在制作一个项目列表,其中我有两列状态,StatusStatus in Words。在前者我需要以数字的形式输入状态,例如50%或80%,在后者中我需要输入项目状态,即打开,关闭,进行中等。我的问题是,当我在第一列写入50%时,另一列中的状态应自动更改如果我在第二列中输入In Progress,则转到Closed,反之亦然,那么第一列中的状态应更改为100%。任何人都可以告诉我如何在Excel vba中进行此操作。

1 个答案:

答案 0 :(得分:-1)

这可能有用。将1更改为较低的列编号,将2更改为较大的列编号。我无法弄清楚如何告诉Excel检查它是否等于“100%”或“50%”,所以我不得不使用1和.5。如果有人知道,请随时编辑或发表评论!

-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
    static CLLocation *lastKnownLocation = nil;

    if(lastKnownLocation == nil) lastKnownLocation = [locations lastObject];
    else
    {
        CLLocation *currentLoc = [locations lastObject];

        // Forming GMSPath from User's last location to User's current location.
        GMSMutablePath *path = [GMSMutablePath new];
        [path addCoordinate:[lastKnownLocation coordinate]];
        [path addCoordinate:[currentLoc coordinate]];

        GMSPolyline *polyLine = [GMSPolyline polylineWithPath:path];
        polyLine.strokeColor = [UIColor redColor];
        polyLine.strokeWidth = 2.f;
        polyLine.map = googleMap;

        // Saving current loc as last known loc,so that we can draw another GMSPolyline from last location to current location when you recieved another callback for this method.
        lastKnownLocation = currentLoc;
    }
}